Class: Veezi::API::Base
- Inherits:
-
Object
- Object
- Veezi::API::Base
- Defined in:
- lib/veezi/api/base.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#api_path ⇒ Object
Returns the value of attribute api_path.
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#parser ⇒ Object
readonly
Returns the value of attribute parser.
Instance Method Summary collapse
- #all ⇒ Object
- #find(id) ⇒ Object
-
#initialize(client) ⇒ Base
constructor
A new instance of Base.
Constructor Details
Instance Attribute Details
#api_path ⇒ Object
Returns the value of attribute api_path.
6 7 8 |
# File 'lib/veezi/api/base.rb', line 6 def api_path @api_path end |
#client ⇒ Object (readonly)
Returns the value of attribute client.
7 8 9 |
# File 'lib/veezi/api/base.rb', line 7 def client @client end |
#parser ⇒ Object (readonly)
Returns the value of attribute parser.
8 9 10 |
# File 'lib/veezi/api/base.rb', line 8 def parser @parser end |
Instance Method Details
#all ⇒ Object
15 16 17 18 |
# File 'lib/veezi/api/base.rb', line 15 def all response = request(:get, self.base_url) self.parser.parse(response) end |
#find(id) ⇒ Object
20 21 22 23 |
# File 'lib/veezi/api/base.rb', line 20 def find(id) response = request(:get, "#{self.base_url}/#{id}") self.parser.parse(response) end |