Module: Lyft::Api::Availability
- Included in:
- Client
- Defined in:
- lib/lyft/api/availability/eta.rb,
lib/lyft/api/availability/cost.rb,
lib/lyft/api/availability/ride_types.rb,
lib/lyft/api/availability/nearby_drivers.rb
Instance Method Summary collapse
-
#cost(args = {}) ⇒ Object
Get Lyft costs.
-
#eta(args = {}) ⇒ Object
Get eta for lyft driver to reach location.
-
#nearby_drivers(args = {}) ⇒ Object
Get positions of nearby drivers.
-
#ride_types(args = {}) ⇒ Object
Get available lyft ride types.
Instance Method Details
#cost(args = {}) ⇒ Object
Get Lyft costs
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/lyft/api/availability/cost.rb', line 18 def cost(args = {}) uri = Lyft.endpoint('/v1/cost') = { headers: { Authorization: "Bearer #{public_token.access_token}" }.as_json, query: { start_lat: args.fetch(:start_lat), start_lng: args.fetch(:start_lng), end_lat: args.fetch(:end_lat), end_lng: args.fetch(:end_lng) } } HTTParty.get(uri, ) end |
#eta(args = {}) ⇒ Object
Get eta for lyft driver to reach location
14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/lyft/api/availability/eta.rb', line 14 def eta(args = {}) uri = Lyft.endpoint('/v1/eta') = { headers: { Authorization: "Bearer #{public_token.access_token}" }.as_json, query: { lat: args.fetch(:lat), lng: args.fetch(:lng) } } HTTParty.get(uri, ) end |
#nearby_drivers(args = {}) ⇒ Object
Get positions of nearby drivers
14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/lyft/api/availability/nearby_drivers.rb', line 14 def nearby_drivers(args = {}) uri = Lyft.endpoint('/v1/drivers') = { headers: { Authorization: "Bearer #{public_token.access_token}" }.as_json, query: { lat: args.fetch(:lat), lng: args.fetch(:lng) } } HTTParty.get(uri, ) end |
#ride_types(args = {}) ⇒ Object
Get available lyft ride types
14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/lyft/api/availability/ride_types.rb', line 14 def ride_types(args = {}) uri = Lyft.endpoint('/v1/ridetypes') = { headers: { Authorization: "Bearer #{public_token.access_token}" }.as_json, query: { lat: args.fetch(:lat), lng: args.fetch(:lng) } } HTTParty.get(uri, ) end |