Class: Mixpanelable::Event

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ Event



5
6
7
8
9
10
# File 'lib/mixpanelable/event.rb', line 5

def initialize(args)
  @distinct_id = args[:distinct_id]
  @token = args[:token]
  @name = args[:name]
  @properties = args[:properties]
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/mixpanelable/event.rb', line 3

def name
  @name
end

Instance Method Details

#propertiesObject



12
13
14
15
16
17
18
# File 'lib/mixpanelable/event.rb', line 12

def properties
  {
    'distinct_id' => @distinct_id,
    'mp_name_tag' => @distinct_id,
    'token'       => @token
  }.merge(@properties)
end