delivery 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 23dd2c7f5f14830e1aa6c57e2eb6712506a5f9d0
4
- data.tar.gz: 586d902b380b7829c6269bf84d8d813b068881dc
3
+ metadata.gz: 9061e2c504790dc67c5217a3160003509b871cc1
4
+ data.tar.gz: 799fc9dfd46a196823d18482093e666504d6d4d3
5
5
  SHA512:
6
- metadata.gz: d8f32b6abce56a22c92dd9dff07e27a6fef919379108278e3f833e752770d1e5a9a3531e0d36f4a255f9b66a0fa696b7bcc488af5bc140af5df63378696a8389
7
- data.tar.gz: 3b2c7027f93d48c38171c2c2487d75426c6c09f1b44bbf51bc5c432ef4639561b8d9055710dd2297cdd13a37718daccc6d005a0e44180a03c28f5839ca06c14e
6
+ metadata.gz: 1f6d9c7a5bce7a8f9f536492970119bc624da0f09409026952c69413b8600feebb4b27a886f5b6f928862ef27b8106f7c20cb85c6c1560efa59f36600005f2dd
7
+ data.tar.gz: ba2919d07304b885c70ca4282a3d307c440992fcdfc3f64bc568c1672f1f3695dd7a8f8fbee2bc44f5c55b9639efc917a679501188b6dcfa6c4f3711a427ef18
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Delivery
2
- VERSION = "1.0.0"
2
+ VERSION = "1.1.0"
3
3
  end
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.0.0
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-12 00:00:00.000000000 Z
11
+ date: 2014-04-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler