Class: RubyUber::V1::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_uber/v1/base.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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(options)
  @client = options[:client]
end

Instance Attribute Details

#clientObject

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

#pathObject



16
17
18
# File 'lib/ruby_uber/v1/base.rb', line 16

def path
  ""
end

#root_keyObject



20
21
# File 'lib/ruby_uber/v1/base.rb', line 20

def root_key
end