Sha256: d421b05ca8f80b29efee71f28436ea5ac12f1e583fffca5ca0610db76273ec7e

Contents?: true

Size: 1.47 KB

Versions: 4

Compression:

Stored size: 1.47 KB

Contents

require 'net/http'
require 'net/https'

require 'cgi'
require 'ostruct'
require 'crack'

begin
  require 'active_support/inflector'
  require 'active_support/deprecation'
rescue LoadError
  require 'active_support'
end

require 'garb/version'
require 'garb/authentication_request'
require 'garb/data_request'
require 'garb/account_feed_request'
require 'garb/session'
require 'garb/profile_reports'
require 'garb/step'
require 'garb/destination'
require 'garb/goal'
require 'garb/profile'
require 'garb/account'
require 'garb/filter_parameters'
require 'garb/report_parameter'
require 'garb/report_response'
require 'garb/resource'
require 'garb/report'

require 'garb/model'

# management
require 'garb/management/feed'
require 'garb/management/account'
require 'garb/management/web_property'
require 'garb/management/profile'

require 'support'

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

  extend self

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

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

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

  def parse_properties(entry)
    entry['dxp:property'].inject({}) do |hash, p|
      hash[Garb.from_ga(p['name'])] = p['value']
      hash
    end
  end

  def parse_link(entry, rel)
    entry['link'].detect {|link| link["rel"] == rel}['href']
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
titanous-garb-0.8.7 lib/garb.rb
titanous-garb-0.8.5 lib/garb.rb
garb-0.8.4 lib/garb.rb
garb-0.8.3 lib/garb.rb