Class: Now

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

Constant Summary collapse

BASEURL =
"https://api.gosquared.com/now/v3/"
DIMENSIONS =
%w(browsers campaigns concurrents engagement geo languages notifications
organisations overview pages platforms sources time timeSeries visitors)
@@filters =
{dateFormat: @date_format, from: @from, to: @to,
format: @format, limit: @limit, sort: @sort,
presenter: @presenter, visitors_mode: @string, href: @href,
drill_limit: @drill_limit, sections: @sections,
minimal: @minimal, interval: @interval}

Instance Method Summary collapse

Constructor Details

#initialize(api_key, site_token, client = Client.new) ⇒ Now

Returns a new instance of Now.



13
14
15
16
17
# File 'lib/gosquared/now.rb', line 13

def initialize(api_key, site_token, client=Client.new)
  @site_token = site_token
  @api_key = api_key
  @client = client
end

Instance Method Details

#fetchObject



34
35
36
37
38
# File 'lib/gosquared/now.rb', line 34

def fetch
  data = @client.get(url)
  @@filters.each{|key, value| @@filters[key]=nil} if data
  data
end