Class: Jbr::Event

Inherits:
Object
  • Object
show all
Defined in:
lib/jbr/event.rb

Constant Summary collapse

SIGNATURE_HEADER =
'X-Jobber-Hmac-SHA256'

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ Event

Returns a new instance of Event.

Parameters:

  • params (Hash) (defaults to: {})

    the payload for an event webhook.



7
8
9
# File 'lib/jbr/event.rb', line 7

def initialize(params = {})
  @params = params
end

Instance Method Details

#account_idString

Returns unique identifier of the event account.

Returns:

  • (String)

    unique identifier of the event account.



15
# File 'lib/jbr/event.rb', line 15

def  = @params.dig :data, :webHookEvent, :accountId

#item_idString

Returns unique identifier of the event target.

Returns:

  • (String)

    unique identifier of the event target.



12
# File 'lib/jbr/event.rb', line 12

def item_id = @params.dig :data, :webHookEvent, :itemId