rlyft 0.1.1 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,36 +0,0 @@
1
- module Lyft
2
- module Api
3
- module Availability
4
- ##
5
- # Get Lyft costs
6
- #
7
- # @example
8
- # client.cost start_lat: 37.7772,
9
- # start_lng: -122.4233,
10
- # end_lat: 37.7972,
11
- # end_lng: -122.4533
12
- #
13
- # @param [Hash] args
14
- # @option args [Float] :start_lat The latitude of starting point. (*required*)
15
- # @option args [Float] :start_lng The longitude of starting point. (*required*)
16
- # @option args [Float] :end_lat The latitude of the end point. (*required*)
17
- # @option args [Float] :end_lng The longitude of the end point. (*required*)
18
- def cost(args = {})
19
- uri = Lyft.endpoint('/v1/cost')
20
- options = {
21
- headers: {
22
- Authorization: "Bearer #{public_token.access_token}"
23
- }.as_json,
24
- query: {
25
- start_lat: args.fetch(:start_lat),
26
- start_lng: args.fetch(:start_lng),
27
- end_lat: args.fetch(:end_lat),
28
- end_lng: args.fetch(:end_lng)
29
- }
30
- }
31
-
32
- HTTParty.get(uri, options)
33
- end
34
- end
35
- end
36
- end
@@ -1,30 +0,0 @@
1
- module Lyft
2
- module Api
3
- module Availability
4
- ##
5
- # Get eta for lyft driver to reach location
6
- #
7
- # @example
8
- # client.eta lat: 37.7772,
9
- # lng: -122.4233
10
- #
11
- # @param [Hash] args
12
- # @option args [Float] :lat The latitude of pickup. (*required*)
13
- # @option args [Float] :lng The longitude of pickup. (*required*)
14
- def eta(args = {})
15
- uri = Lyft.endpoint('/v1/eta')
16
- options = {
17
- headers: {
18
- Authorization: "Bearer #{public_token.access_token}"
19
- }.as_json,
20
- query: {
21
- lat: args.fetch(:lat),
22
- lng: args.fetch(:lng)
23
- }
24
- }
25
-
26
- HTTParty.get(uri, options)
27
- end
28
- end
29
- end
30
- end
@@ -1,30 +0,0 @@
1
- module Lyft
2
- module Api
3
- module Availability
4
- ##
5
- # Get positions of nearby drivers
6
- #
7
- # @example
8
- # client.nearby_drivers lat: 37.7772,
9
- # lng: -122.4233
10
- #
11
- # @param [Hash] args
12
- # @option args [Float] :lat The latitude of pickup. (*required*)
13
- # @option args [Float] :lng The longitude of pickup. (*required*)
14
- def nearby_drivers(args = {})
15
- uri = Lyft.endpoint('/v1/drivers')
16
- options = {
17
- headers: {
18
- Authorization: "Bearer #{public_token.access_token}"
19
- }.as_json,
20
- query: {
21
- lat: args.fetch(:lat),
22
- lng: args.fetch(:lng)
23
- }
24
- }
25
-
26
- HTTParty.get(uri, options)
27
- end
28
- end
29
- end
30
- end
@@ -1,30 +0,0 @@
1
- module Lyft
2
- module Api
3
- module Availability
4
- ##
5
- # Get available lyft ride types
6
- #
7
- # @example
8
- # client.ride_types lat: 37.7772,
9
- # lng: -122.4233
10
- #
11
- # @param [Hash] args
12
- # @option args [Float] :lat The latitude of pickup. (*required*)
13
- # @option args [Float] :lng The longitude of pickup. (*required*)
14
- def ride_types(args = {})
15
- uri = Lyft.endpoint('/v1/ridetypes')
16
- options = {
17
- headers: {
18
- Authorization: "Bearer #{public_token.access_token}"
19
- }.as_json,
20
- query: {
21
- lat: args.fetch(:lat),
22
- lng: args.fetch(:lng)
23
- }
24
- }
25
-
26
- HTTParty.get(uri, options)
27
- end
28
- end
29
- end
30
- end
@@ -1,29 +0,0 @@
1
- module Lyft
2
- module Api
3
- module Oauth
4
- ##
5
- # Retrieve public oauth token.
6
- #
7
- # @todo Use same token until expires
8
- #
9
- def public_token(renew = false)
10
- # return @public_token unless @public_token.nil? && !renew
11
-
12
- uri = Lyft.endpoint('/oauth/token')
13
- options = {
14
- body: {
15
- grant_type: 'client_credentials',
16
- scope: 'public'
17
- },
18
- basic_auth: {
19
- username: @client_id,
20
- password: @client_secret
21
- }
22
- }
23
-
24
- response = HTTParty.post(uri, options).deep_symbolize_keys!
25
- @public_token = Struct.new(*response.keys).new(*response.values)
26
- end
27
- end
28
- end
29
- end
@@ -1,8 +0,0 @@
1
- module Lyft
2
- module Api
3
- module Rides
4
- def ride
5
- end
6
- end
7
- end
8
- end
@@ -1,8 +0,0 @@
1
- module Lyft
2
- module Api
3
- module Rides
4
- def ride_cancel
5
- end
6
- end
7
- end
8
- end
@@ -1,8 +0,0 @@
1
- module Lyft
2
- module Api
3
- module Rides
4
- def ride_details
5
- end
6
- end
7
- end
8
- end
@@ -1,8 +0,0 @@
1
- module Lyft
2
- module Api
3
- module Rides
4
- def ride_rating_and_tipping
5
- end
6
- end
7
- end
8
- end
@@ -1,8 +0,0 @@
1
- module Lyft
2
- module Api
3
- module Rides
4
- def ride_receipt
5
- end
6
- end
7
- end
8
- end
@@ -1,8 +0,0 @@
1
- module Lyft
2
- module Api
3
- module Users
4
- def profile
5
- end
6
- end
7
- end
8
- end
@@ -1,8 +0,0 @@
1
- module Lyft
2
- module Api
3
- module Users
4
- def ride_history
5
- end
6
- end
7
- end
8
- end