delivery 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/delivery/client.rb +9 -8
- data/lib/delivery/version.rb +1 -1
- data/test/test_client.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9061e2c504790dc67c5217a3160003509b871cc1
|
4
|
+
data.tar.gz: 799fc9dfd46a196823d18482093e666504d6d4d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1f6d9c7a5bce7a8f9f536492970119bc624da0f09409026952c69413b8600feebb4b27a886f5b6f928862ef27b8106f7c20cb85c6c1560efa59f36600005f2dd
|
7
|
+
data.tar.gz: ba2919d07304b885c70ca4282a3d307c440992fcdfc3f64bc568c1672f1f3695dd7a8f8fbee2bc44f5c55b9639efc917a679501188b6dcfa6c4f3711a427ef18
|
data/lib/delivery/client.rb
CHANGED
@@ -15,31 +15,32 @@ module Delivery
|
|
15
15
|
@base_uri = options[:base_uri]
|
16
16
|
end
|
17
17
|
|
18
|
-
def search(address)
|
19
|
-
options = {query: {client_id: client_id, address: address}}
|
18
|
+
def search(address, options={})
|
19
|
+
options = {query: {client_id: client_id, address: address}.merge(options)}
|
20
20
|
response = self.class.get("#{base_uri}/merchant/search/delivery", options)
|
21
21
|
Hashie::Mash.new(JSON.parse(response.body))
|
22
22
|
end
|
23
23
|
alias_method :merchant_search, :search
|
24
24
|
|
25
|
-
def info(id)
|
26
|
-
options = {query: {client_id: client_id}}
|
25
|
+
def info(id, options={})
|
26
|
+
options = {query: {client_id: client_id}.merge(options)}
|
27
27
|
response = self.class.get("#{base_uri}/merchant/#{id}", options)
|
28
28
|
Hashie::Mash.new(JSON.parse(response.body))
|
29
29
|
end
|
30
30
|
alias_method :merchant_info, :info
|
31
31
|
|
32
|
-
def menu(id)
|
33
|
-
options = {query: {client_id: client_id}}
|
32
|
+
def menu(id, options={})
|
33
|
+
options = {query: {client_id: client_id}.merge(options)}
|
34
34
|
response = self.class.get("#{base_uri}/merchant/#{id}/menu", options)
|
35
35
|
Hashie::Mash.new(JSON.parse(response.body))
|
36
36
|
end
|
37
37
|
alias_method :merchant_menu, :menu
|
38
38
|
|
39
|
-
def hours(id)
|
40
|
-
options = {query: {client_id: client_id}}
|
39
|
+
def hours(id, options={})
|
40
|
+
options = {query: {client_id: client_id}.merge(options)}
|
41
41
|
response = self.class.get("#{base_uri}/merchant/#{id}/hours", options)
|
42
42
|
Hashie::Mash.new(JSON.parse(response.body))
|
43
43
|
end
|
44
|
+
alias_method :merchant_hours, :hours
|
44
45
|
end
|
45
46
|
end
|
data/lib/delivery/version.rb
CHANGED
data/test/test_client.rb
CHANGED
@@ -6,10 +6,10 @@ class TestClient < Minitest::Test
|
|
6
6
|
end
|
7
7
|
|
8
8
|
def test_search
|
9
|
-
stub_request(:get, 'http://sandbox.delivery.com/merchant/search/delivery?client_id=client_id&address=199%20Water%20St%2010038').
|
9
|
+
stub_request(:get, 'http://sandbox.delivery.com/merchant/search/delivery?client_id=client_id&address=199%20Water%20St%2010038&method=delivery').
|
10
10
|
to_return(body: fixture('search.json'), headers: {content_type: 'application/json'})
|
11
11
|
|
12
|
-
search = @client.search '199 Water St 10038'
|
12
|
+
search = @client.search '199 Water St 10038', method: 'delivery'
|
13
13
|
assert_equal 40.706888574096, search.search_address.latitude
|
14
14
|
end
|
15
15
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: delivery
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James A. Anderson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04-
|
11
|
+
date: 2014-04-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|