Module: Uber::API::Products

Included in:
Uber::API
Defined in:
lib/uber/api/products.rb

Instance Method Summary collapse

Instance Method Details

#apply_availability(product_id, value) ⇒ Object



23
24
25
26
27
28
29
30
# File 'lib/uber/api/products.rb', line 23

def apply_availability(product_id, value)
  perform_with_object(
    :put,
    "/v1/sandbox/products/#{product_id}",
    { drivers_available: value },
    Product
  )
end

#apply_surge(product_id, surge_multiplier) ⇒ Object



14
15
16
17
18
19
20
21
# File 'lib/uber/api/products.rb', line 14

def apply_surge(product_id, surge_multiplier)
  perform_with_object(
    :put,
    "/v1/sandbox/products/#{product_id}",
    { surge_multiplier: surge_multiplier },
    Product
  )
end

#products(*args) ⇒ Object



9
10
11
12
# File 'lib/uber/api/products.rb', line 9

def products(*args)
  arguments = Uber::Arguments.new(args)
  perform_with_objects(:get, "/v1/products", arguments.options, Product)
end