Class: Gosquared::Now

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

Constant Summary collapse

BASEURL =
"https://api.gosquared.com/now/v3/".freeze
DIMENSIONS =
%w(browsers campaigns concurrents engagement geo languages notifications
organisations overview pages platforms sources time timeSeries visitors).freeze
@@filters =
{date_format: @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 = Gosquared::Client.new) ⇒ Now

Returns a new instance of Now.



15
16
17
18
19
# File 'lib/gosquared/now.rb', line 15

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

Instance Method Details

#fetchObject



36
37
38
39
40
# File 'lib/gosquared/now.rb', line 36

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