uber-ruby 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/uber/api.rb +2 -0
- data/lib/uber/client.rb +3 -1
- data/lib/uber/price.rb +1 -1
- data/lib/uber/promotion.rb +5 -0
- data/lib/uber/promotions.rb +14 -0
- data/lib/uber/version.rb +1 -1
- data/uber-ruby.gemspec +1 -4
- metadata +4 -68
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4d8a36ba249d7f917cd2dc5f791a213e888c3cf4
|
4
|
+
data.tar.gz: 65a1fbd1b6fa2aec7b67b5db49822c27f23eecd3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 870c4cd258f4c0196654a890f306d462b2354f6ceefd62c55684ead9eb9d40e1c8db3f281c858996e237c2140ce422e73729d9f0f21890f3e23a3a504b101c43
|
7
|
+
data.tar.gz: 0312fa6daa454b8fc8a0169e4addec3714a2b78bccb1cea509f25895bd23df137894d32e6be464e2463666861da9195be4a2599de9c5db9c18faf93cfa7cffcd
|
data/lib/uber/api.rb
CHANGED
@@ -3,6 +3,7 @@ require 'uber/price_estimates'
|
|
3
3
|
require 'uber/time_estimates'
|
4
4
|
require 'uber/activities'
|
5
5
|
require 'uber/me'
|
6
|
+
require 'uber/promotions'
|
6
7
|
|
7
8
|
module Uber
|
8
9
|
module API
|
@@ -12,5 +13,6 @@ module Uber
|
|
12
13
|
include Uber::API::TimeEstimates
|
13
14
|
include Uber::API::Activities
|
14
15
|
include Uber::API::Me
|
16
|
+
include Uber::API::Promotions
|
15
17
|
end
|
16
18
|
end
|
data/lib/uber/client.rb
CHANGED
@@ -58,8 +58,10 @@ module Uber
|
|
58
58
|
faraday.response :raise_error
|
59
59
|
# Parse JSON response bodies
|
60
60
|
faraday.response :parse_json
|
61
|
+
# Use instrumentation if available
|
62
|
+
faraday.use :instrumentation if defined?(FaradayMiddleware::Instrumentation)
|
61
63
|
# Set default HTTP adapter
|
62
|
-
faraday.adapter
|
64
|
+
faraday.adapter Faraday.default_adapter
|
63
65
|
end
|
64
66
|
end
|
65
67
|
|
data/lib/uber/price.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
module Uber
|
2
2
|
class Price < Base
|
3
|
-
attr_accessor :product_id, :currency_code, :display_name, :estimate, :low_estimate, :high_estimate, :surge_multipler
|
3
|
+
attr_accessor :product_id, :currency_code, :display_name, :estimate, :low_estimate, :high_estimate, :surge_multipler, :duration, :distance
|
4
4
|
end
|
5
5
|
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'uber/arguments'
|
2
|
+
require 'uber/request'
|
3
|
+
require 'uber/promotion'
|
4
|
+
|
5
|
+
module Uber
|
6
|
+
module API
|
7
|
+
module Promotions
|
8
|
+
def promotion(*args)
|
9
|
+
arguments = Uber::Arguments.new(args)
|
10
|
+
perform_with_object(:get, "/v1/promotions", arguments.options, Promotion)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
data/lib/uber/version.rb
CHANGED
data/uber-ruby.gemspec
CHANGED
@@ -24,9 +24,6 @@ Gem::Specification.new do |spec|
|
|
24
24
|
spec.add_development_dependency "bundler", "~> 1.5"
|
25
25
|
spec.add_development_dependency "rake", '~> 0'
|
26
26
|
|
27
|
-
spec.add_dependency '
|
28
|
-
spec.add_dependency 'faraday', '~> 0.9.0', '>= 0.9.0'
|
29
|
-
spec.add_dependency 'http', '~> 0.5.0', '>= 0.5.0'
|
30
|
-
spec.add_dependency 'http_parser.rb', '~> 0.6.0', '>= 0.6.0'
|
27
|
+
spec.add_dependency 'faraday', '~> 0.9.0'
|
31
28
|
spec.add_dependency 'json', '~> 1.8'
|
32
29
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: uber-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dingding Ye
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-04-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -38,26 +38,6 @@ dependencies:
|
|
38
38
|
- - ~>
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: oauth2
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - ~>
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: 1.0.0
|
48
|
-
- - '>='
|
49
|
-
- !ruby/object:Gem::Version
|
50
|
-
version: 1.0.0
|
51
|
-
type: :runtime
|
52
|
-
prerelease: false
|
53
|
-
version_requirements: !ruby/object:Gem::Requirement
|
54
|
-
requirements:
|
55
|
-
- - ~>
|
56
|
-
- !ruby/object:Gem::Version
|
57
|
-
version: 1.0.0
|
58
|
-
- - '>='
|
59
|
-
- !ruby/object:Gem::Version
|
60
|
-
version: 1.0.0
|
61
41
|
- !ruby/object:Gem::Dependency
|
62
42
|
name: faraday
|
63
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -65,9 +45,6 @@ dependencies:
|
|
65
45
|
- - ~>
|
66
46
|
- !ruby/object:Gem::Version
|
67
47
|
version: 0.9.0
|
68
|
-
- - '>='
|
69
|
-
- !ruby/object:Gem::Version
|
70
|
-
version: 0.9.0
|
71
48
|
type: :runtime
|
72
49
|
prerelease: false
|
73
50
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -75,49 +52,6 @@ dependencies:
|
|
75
52
|
- - ~>
|
76
53
|
- !ruby/object:Gem::Version
|
77
54
|
version: 0.9.0
|
78
|
-
- - '>='
|
79
|
-
- !ruby/object:Gem::Version
|
80
|
-
version: 0.9.0
|
81
|
-
- !ruby/object:Gem::Dependency
|
82
|
-
name: http
|
83
|
-
requirement: !ruby/object:Gem::Requirement
|
84
|
-
requirements:
|
85
|
-
- - ~>
|
86
|
-
- !ruby/object:Gem::Version
|
87
|
-
version: 0.5.0
|
88
|
-
- - '>='
|
89
|
-
- !ruby/object:Gem::Version
|
90
|
-
version: 0.5.0
|
91
|
-
type: :runtime
|
92
|
-
prerelease: false
|
93
|
-
version_requirements: !ruby/object:Gem::Requirement
|
94
|
-
requirements:
|
95
|
-
- - ~>
|
96
|
-
- !ruby/object:Gem::Version
|
97
|
-
version: 0.5.0
|
98
|
-
- - '>='
|
99
|
-
- !ruby/object:Gem::Version
|
100
|
-
version: 0.5.0
|
101
|
-
- !ruby/object:Gem::Dependency
|
102
|
-
name: http_parser.rb
|
103
|
-
requirement: !ruby/object:Gem::Requirement
|
104
|
-
requirements:
|
105
|
-
- - ~>
|
106
|
-
- !ruby/object:Gem::Version
|
107
|
-
version: 0.6.0
|
108
|
-
- - '>='
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
version: 0.6.0
|
111
|
-
type: :runtime
|
112
|
-
prerelease: false
|
113
|
-
version_requirements: !ruby/object:Gem::Requirement
|
114
|
-
requirements:
|
115
|
-
- - ~>
|
116
|
-
- !ruby/object:Gem::Version
|
117
|
-
version: 0.6.0
|
118
|
-
- - '>='
|
119
|
-
- !ruby/object:Gem::Version
|
120
|
-
version: 0.6.0
|
121
55
|
- !ruby/object:Gem::Dependency
|
122
56
|
name: json
|
123
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -156,6 +90,8 @@ files:
|
|
156
90
|
- lib/uber/price_estimates.rb
|
157
91
|
- lib/uber/product.rb
|
158
92
|
- lib/uber/products.rb
|
93
|
+
- lib/uber/promotion.rb
|
94
|
+
- lib/uber/promotions.rb
|
159
95
|
- lib/uber/rate_limit.rb
|
160
96
|
- lib/uber/request.rb
|
161
97
|
- lib/uber/time.rb
|