class Trends

Constants

BASEURL
DIMENSIONS

Public Class Methods

new(api_key, site_token, client=Client.new) click to toggle source
# File lib/gosquared/trends.rb, line 9
def initialize(api_key, site_token, client=Client.new)
  @site_token = site_token
  @api_key = api_key
  @client = client
end

Public Instance Methods

fetch() click to toggle source
# File lib/gosquared/trends.rb, line 29
def fetch
  data = @client.get(url)
  @@filters.each{|key, value| @@filters[key]=nil} if data
  data
end

Private Instance Methods

url() click to toggle source
# File lib/gosquared/trends.rb, line 37
def url
  array = [""]
  url = BASEURL + @dimension + "?api_key=#{@api_key}" + "&site_token=#{@site_token}"
  @@filters.each {|key, value| array << "#{key}=#{value}" if value }
  parameters=array.join('&')
  url.concat(parameters)
end