Class: GoogleAnalyticsOnRails::GoogleAnalytics

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ GoogleAnalytics

Returns a new instance of GoogleAnalytics.



36
37
38
39
# File 'lib/google_analytics_on_rails.rb', line 36

def initialize(*args)
  options     = args.extract_options!
  @tracker_id = args.shift
end

Instance Attribute Details

#tracker_idObject

Returns the value of attribute tracker_id.



34
35
36
# File 'lib/google_analytics_on_rails.rb', line 34

def tracker_id
  @tracker_id
end

Instance Method Details

#validate!Object

Raises:



41
42
43
# File 'lib/google_analytics_on_rails.rb', line 41

def validate!
  raise InvalidProfile, "TrackerId is missing or invalid" if tracker_id.blank?
end