Class: Singleplatform::Client

Inherits:
Object
  • Object
show all
Includes:
Locations, Menus, Photos
Defined in:
lib/singleplatform/client.rb,
lib/singleplatform/client/menus.rb,
lib/singleplatform/client/photos.rb,
lib/singleplatform/client/locations.rb

Defined Under Namespace

Modules: Locations, Menus, Photos

Constant Summary collapse

BASE_URL =
'http://publishing-api.singleplatform.com'

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Photos

#photos_for, #photos_updated_since

Methods included from Menus

#menus_for

Methods included from Locations

#all_for, #location, #locations_updated_since

Constructor Details

#initialize(args = {}) ⇒ Singleplatform::Client

Initializes a new API Client Object



23
24
25
26
27
28
# File 'lib/singleplatform/client.rb', line 23

def initialize(args = {})
  @base_url      = BASE_URL
  @client_id     = args[:client_id]
  @client_secret = args[:client_secret]
  raise Error::MissingCredentialsError if credentials_missing?
end

Instance Attribute Details

#base_urlObject

Returns the value of attribute base_url.



12
13
14
# File 'lib/singleplatform/client.rb', line 12

def base_url
  @base_url
end

#client_idObject

Returns the value of attribute client_id.



12
13
14
# File 'lib/singleplatform/client.rb', line 12

def client_id
  @client_id
end

#client_secretObject

Returns the value of attribute client_secret.



12
13
14
# File 'lib/singleplatform/client.rb', line 12

def client_secret
  @client_secret
end