Class: GaEvents::Event

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(category, action, label = nil, value = nil) ⇒ Event

Returns a new instance of Event.



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

def initialize(category, action, label = nil, value = nil)
  super
  GaEvents::List << self
end

Instance Attribute Details

#actionObject

Returns the value of attribute action

Returns:

  • (Object)

    the current value of action



2
3
4
# File 'lib/ga_events/event.rb', line 2

def action
  @action
end

#categoryObject

Returns the value of attribute category

Returns:

  • (Object)

    the current value of category



2
3
4
# File 'lib/ga_events/event.rb', line 2

def category
  @category
end

#labelObject

Returns the value of attribute label

Returns:

  • (Object)

    the current value of label



2
3
4
# File 'lib/ga_events/event.rb', line 2

def label
  @label
end

#valueObject

Returns the value of attribute value

Returns:

  • (Object)

    the current value of value



2
3
4
# File 'lib/ga_events/event.rb', line 2

def value
  @value
end

Instance Method Details

#to_sObject



8
9
10
# File 'lib/ga_events/event.rb', line 8

def to_s
  [category, action, label, value].join('|')
end