Module: GaEvents::List

Extended by:
Forwardable
Defined in:
lib/ga_events/list.rb

Class Method Summary collapse

Class Method Details

.init(str = nil) ⇒ Object

Init list, optionally with a string of serialized events



19
20
21
22
# File 'lib/ga_events/list.rb', line 19

def init(str = nil)
  Thread.current[:ga_events] = []
  (str || '').split('$').each { |s| GaEvents::Event.from_string(s) }
end

.to_sObject



14
15
16
# File 'lib/ga_events/list.rb', line 14

def to_s
  data.collect(&:to_s).join('$')
end