Class: CustomerCreated

Inherits:
Webhook show all
Defined in:
lib/k2-connect-ruby/k2_services/payloads/webhooks/customer_created.rb

Instance Attribute Summary collapse

Attributes inherited from Webhook

#created_at, #event_resource, #event_type, #id, #links_resource, #links_self, #resource_id, #topic

Instance Method Summary collapse

Constructor Details

#initialize(payload) ⇒ CustomerCreated

Returns a new instance of CustomerCreated.



7
8
9
10
11
12
13
# File 'lib/k2-connect-ruby/k2_services/payloads/webhooks/customer_created.rb', line 7

def initialize(payload)
  super
  @resource_first_name = payload.dig('event', 'resource', 'first_name')
  @resource_middle_name = payload.dig('event', 'resource', 'middle_name')
  @resource_last_name = payload.dig('event', 'resource', 'last_name')
  @resource_phone_number = payload.dig('event', 'resource', 'phone_number')
end

Instance Attribute Details

#resource_first_nameObject (readonly)

Returns the value of attribute resource_first_name.



2
3
4
# File 'lib/k2-connect-ruby/k2_services/payloads/webhooks/customer_created.rb', line 2

def resource_first_name
  @resource_first_name
end

#resource_last_nameObject (readonly)

Returns the value of attribute resource_last_name.



2
3
4
# File 'lib/k2-connect-ruby/k2_services/payloads/webhooks/customer_created.rb', line 2

def resource_last_name
  @resource_last_name
end

#resource_middle_nameObject (readonly)

Returns the value of attribute resource_middle_name.



2
3
4
# File 'lib/k2-connect-ruby/k2_services/payloads/webhooks/customer_created.rb', line 2

def resource_middle_name
  @resource_middle_name
end

#resource_phone_numberObject (readonly)

Returns the value of attribute resource_phone_number.



2
3
4
# File 'lib/k2-connect-ruby/k2_services/payloads/webhooks/customer_created.rb', line 2

def resource_phone_number
  @resource_phone_number
end