lib/gabba/gabba.rb
def hey(params)
      query = params.map {|k,v| "#{k}=#{URI.escape(v.to_s, Regexp.new("[^#{URI::PATTERN::UNRESERVED}]"))}" }.join('&')

      @http ||= Net::HTTP::Persistent.new 'Gabba'

      request = Net::HTTP::Get.new("#{BEACON_PATH}?#{query}")
      request["User-Agent"] = URI.escape(user_agent)
      request["Accept"] = "*/*"
      uri = URI "#{PROTOCOL}://#{GOOGLE_HOST}/#{BEACON_PATH}"
      response = @http.request(uri, request)

      raise GoogleAnalyticsNetworkError unless response.code == "200"
      response
    end
# makes the tracking call to Google Analytics
makes the tracking call to Google Analytics
makes the tracking call to Google Analytics
def hey(params)
      query = params.map {|k,v| "#{k}=#{URI.escape(v.to_s, Regexp.new("[^#{URI::PATTERN::UNRESERVED}]"))}" }.join('&')
      @http ||= Net::HTTP::Persistent.new 'Gabba'
      request = Net::HTTP::Get.new("#{BEACON_PATH}?#{query}")
      request["User-Agent"] = URI.escape(user_agent)
      request["Accept"] = "*/*"
      uri = URI "#{PROTOCOL}://#{GOOGLE_HOST}/#{BEACON_PATH}"
      response = @http.request(uri, request)
      raise GoogleAnalyticsNetworkError unless response.code == "200"
      response
    end
def hey ( params ) query = params . map { | k , v | "#{k}=#{URI.escape(v.to_s, Regexp.new("[^#{URI::PATTERN::UNRESERVED}]"))}" } . join ( '&' ) @http ||= Net :: HTTP :: Persistent . new 'Gabba' request = Net :: HTTP :: Get . new ( "#{BEACON_PATH}?#{query}" ) request [ "User-Agent" ] = URI . escape ( user_agent ) request [ "Accept" ] = "*/*" uri = URI "#{PROTOCOL}://#{GOOGLE_HOST}/#{BEACON_PATH}" response = @http . request ( uri , request ) raise GoogleAnalyticsNetworkError unless response . code == "200" response end
makes the tracking call to Google Analytics
makes the tracking call to Google Analytics
params