Class: Gosquared::RubyLibrary

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

Instance Method Summary collapse

Constructor Details

#initialize(api_key, site_id) ⇒ RubyLibrary

Returns a new instance of RubyLibrary.


11
12
13
14
15
16
# File 'lib/gosquared.rb', line 11

def initialize(api_key, site_id)
  @api_key = api_key
  @site_id = site_id
  raise 'api key cannot be empty/nil' if api_key.nil? || api_key.empty?
  raise 'site_token cannot be empty/nil' if site_id.nil? || site_id.empty?
end

Instance Method Details

#accountObject


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

def 
  @account ||= Gosquared::Account.new(@api_key, @site_id)
end

#nowObject


30
31
32
# File 'lib/gosquared.rb', line 30

def now
  @now ||= Gosquared::Now.new(@api_key, @site_id)
end

#peopleObject


26
27
28
# File 'lib/gosquared.rb', line 26

def people
  @people ||= Gosquared::People.new(@api_key, @site_id)
end

#trackingObject


22
23
24
# File 'lib/gosquared.rb', line 22

def tracking
  @tracking ||= Gosquared::Tracking.new(@api_key, @site_id)
end

18
19
20
# File 'lib/gosquared.rb', line 18

def trends
  @trends ||= Gosquared::Trends.new(@api_key, @site_id)
end