Module: Garb

Defined in:
lib/garb.rb,
lib/garb/report.rb,
lib/garb/account.rb,
lib/garb/profile.rb,
lib/garb/session.rb,
lib/garb/version.rb,
lib/garb/resource.rb,
lib/garb/data_request.rb,
lib/garb/profile_reports.rb,
lib/garb/report_response.rb,
lib/garb/report_parameter.rb,
lib/garb/filter_parameters.rb,
lib/garb/authentication_request.rb

Defined Under Namespace

Modules: ProfileReports, Resource, Version Classes: Account, AuthenticationRequest, DataRequest, FilterParameters, Profile, Report, ReportParameter, ReportResponse, Session

Constant Summary collapse

GA =
"http://schemas.google.com/analytics/2008"

Class Method Summary collapse

Class Method Details

.from_google_analytics(thing) ⇒ Object



35
36
37
# File 'lib/garb.rb', line 35

def self.from_google_analytics(thing)
  thing.to_s.gsub(/^ga\:/, '').underscore
end

.to_google_analytics(thing) ⇒ Object



29
30
31
32
33
# File 'lib/garb.rb', line 29

def self.to_google_analytics(thing)
  return thing.to_google_analytics if thing.respond_to?(:to_google_analytics)

  "ga:#{thing.to_s.camelize(:lower)}"
end