Class: GAQ::EventRenderer

Inherits:
Object
  • Object
show all
Defined in:
lib/google_analytics_tools/tracking/events/event_renderer.rb

Instance Method Summary collapse

Constructor Details

#initialize(event, tracker_id) ⇒ EventRenderer

Returns a new instance of EventRenderer.


5
6
7
8
# File 'lib/google_analytics_tools/tracking/events/event_renderer.rb', line 5

def initialize(event, tracker_id)
  @event = event
  @tracker_id = tracker_id
end

Instance Method Details

#to_sObject


10
11
12
# File 'lib/google_analytics_tools/tracking/events/event_renderer.rb', line 10

def to_s
  "_gaq.push(#{[@tracker_id ? "#{@tracker_id}.#{@event.name}" : @event.name, *@event.params].to_json});"
end