Class: LucidIntercom::Event
- Inherits:
-
Object
- Object
- LucidIntercom::Event
show all
- Extended by:
- Dry::Initializer
- Defined in:
- lib/lucid_intercom/event.rb
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
.event(event_name) ⇒ Object
Set the event name for the subclass.
29
30
31
32
33
|
# File 'lib/lucid_intercom/event.rb', line 29
def self.event(event_name)
define_method(:event_name) do
"#{LucidIntercom.app_prefix}_#{event_name}"
end
end
|
Instance Method Details
#app_data ⇒ Hash
Additional custom attributes related to the event (unprefixed).
64
65
66
|
# File 'lib/lucid_intercom/event.rb', line 64
def app_data
{}
end
|
15
|
# File 'lib/lucid_intercom/event.rb', line 15
option :company, default: proc { CompanyAttributes.new(shopify_data) }
|
17
|
# File 'lib/lucid_intercom/event.rb', line 17
option :company_custom, default: proc { CompanyCustomAttributes.new(shopify_data, app_data) }
|
49
50
51
|
# File 'lib/lucid_intercom/event.rb', line 49
def event_metadata
raise NotImplementedError
end
|
#event_name ⇒ String
40
41
42
|
# File 'lib/lucid_intercom/event.rb', line 40
def event_name
raise NotImplementedError
end
|
#shopify_data ⇒ Hash
Returns shop attributes as returned by the Shopify API.
13
|
# File 'lib/lucid_intercom/event.rb', line 13
param :shopify_data
|
19
|
# File 'lib/lucid_intercom/event.rb', line 19
option :user, default: proc { UserAttributes.new(shopify_data) }
|
#user_id ⇒ Hash
71
72
73
74
75
|
# File 'lib/lucid_intercom/event.rb', line 71
def user_id
{
user.id_key => user.id,
}
end
|