Class: Spotted::Resources::Webhooks

Inherits:
Object
  • Object
show all
Defined in:
lib/spotted/resources/webhooks.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Webhooks

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Webhooks.

Parameters:



17
18
19
# File 'lib/spotted/resources/webhooks.rb', line 17

def initialize(client:)
  @client = client
end

Instance Method Details

#unwrap(payload) ⇒ Object

Parameters:

  • payload (String)

    The raw webhook payload as a string

Returns:

  • (Object)


9
10
11
12
# File 'lib/spotted/resources/webhooks.rb', line 9

def unwrap(payload)
  parsed = JSON.parse(payload, symbolize_names: true)
  Spotted::Internal::Type::Converter.coerce(Spotted::Models::UnwrapWebhookEvent, parsed)
end