Class: Mirror::Api::Client
- Inherits:
-
Object
- Object
- Mirror::Api::Client
- Defined in:
- lib/mirror-api/client.rb
Instance Attribute Summary collapse
-
#credentials ⇒ Object
Returns the value of attribute credentials.
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
- #contacts ⇒ Object
-
#initialize(credentials, options = {raise_errors: false}) ⇒ Client
constructor
A new instance of Client.
- #locations ⇒ Object
- #subscriptions ⇒ Object
- #timeline ⇒ Object
Constructor Details
#initialize(credentials, options = {raise_errors: false}) ⇒ Client
Returns a new instance of Client.
9 10 11 12 13 |
# File 'lib/mirror-api/client.rb', line 9 def initialize(credentials, ={raise_errors: false}) self.credentials = credentials self. = raise "Invalid credentials. Missing token" unless (self.credentials && self.credentials[:token]) end |
Instance Attribute Details
#credentials ⇒ Object
Returns the value of attribute credentials.
7 8 9 |
# File 'lib/mirror-api/client.rb', line 7 def credentials @credentials end |
#options ⇒ Object
Returns the value of attribute options.
7 8 9 |
# File 'lib/mirror-api/client.rb', line 7 def @options end |
Instance Method Details
#contacts ⇒ Object
35 36 37 |
# File 'lib/mirror-api/client.rb', line 35 def contacts @contacts ||= Resource.new(credentials, Request::CONTACTS, ) end |
#locations ⇒ Object
31 32 33 |
# File 'lib/mirror-api/client.rb', line 31 def locations @locations ||= Resource.new(credentials, Request::LOCATIONS, ) end |
#subscriptions ⇒ Object
27 28 29 |
# File 'lib/mirror-api/client.rb', line 27 def subscriptions @subscriptions ||= Resource.new(credentials, Request::SUBSCRIPTIONS, ) end |