Class: Distimo::Client
- Inherits:
-
Object
- Object
- Distimo::Client
- Includes:
- API, HTTParty
- Defined in:
- lib/distimo/client.rb
Constant Summary
Constants included from API
Instance Attribute Summary collapse
-
#password ⇒ Object
Returns the value of attribute password.
-
#private_key ⇒ Object
Returns the value of attribute private_key.
-
#public_key ⇒ Object
Returns the value of attribute public_key.
-
#token ⇒ Object
Returns the value of attribute token.
-
#username ⇒ Object
Returns the value of attribute username.
Instance Method Summary collapse
- #get(path, query) ⇒ Object
-
#initialize(opts) ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize(opts) ⇒ Client
Returns a new instance of Client.
12 13 14 |
# File 'lib/distimo/client.rb', line 12 def initialize opts opts.each {|k,v| send("#{k}=",v)} end |
Instance Attribute Details
#password ⇒ Object
Returns the value of attribute password.
10 11 12 |
# File 'lib/distimo/client.rb', line 10 def password @password end |
#private_key ⇒ Object
Returns the value of attribute private_key.
10 11 12 |
# File 'lib/distimo/client.rb', line 10 def private_key @private_key end |
#public_key ⇒ Object
Returns the value of attribute public_key.
10 11 12 |
# File 'lib/distimo/client.rb', line 10 def public_key @public_key end |
#token ⇒ Object
Returns the value of attribute token.
10 11 12 |
# File 'lib/distimo/client.rb', line 10 def token @token end |
#username ⇒ Object
Returns the value of attribute username.
10 11 12 |
# File 'lib/distimo/client.rb', line 10 def username @username end |
Instance Method Details
#get(path, query) ⇒ Object
16 17 18 19 20 21 |
# File 'lib/distimo/client.rb', line 16 def get path, query = prepare(query) response = self.class.get path, raise Error.from_response(response) if response.code >= 400 response end |