Class: RubyUber::V1::Base
- Inherits:
-
Object
- Object
- RubyUber::V1::Base
- Defined in:
- lib/ruby_uber/v1/base.rb
Direct Known Subclasses
PriceEstimates, Products, TimeEstimates, UserActivity, UserProfile
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
Instance Method Summary collapse
- #get(query = {}) ⇒ Object
-
#initialize(options) ⇒ Base
constructor
A new instance of Base.
- #path ⇒ Object
- #root_key ⇒ Object
Constructor Details
#initialize(options) ⇒ Base
Returns a new instance of Base.
7 8 9 |
# File 'lib/ruby_uber/v1/base.rb', line 7 def initialize() @client = [:client] end |
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client.
5 6 7 |
# File 'lib/ruby_uber/v1/base.rb', line 5 def client @client end |
Instance Method Details
#get(query = {}) ⇒ Object
11 12 13 14 |
# File 'lib/ruby_uber/v1/base.rb', line 11 def get(query = {}) body = Utility.symbolize_keys(client.get(path, query).body) root_key ? body.fetch(root_key) { body } : body end |
#path ⇒ Object
16 17 18 |
# File 'lib/ruby_uber/v1/base.rb', line 16 def path "" end |
#root_key ⇒ Object
20 21 |
# File 'lib/ruby_uber/v1/base.rb', line 20 def root_key end |