booker_ruby 3.0.4 → 3.0.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5cebcad438ddf6b858711d5217437dd980ea1907
4
- data.tar.gz: e6f8e5898b145db06d5ea1b2f6c336caccb86d8b
3
+ metadata.gz: bf1b0e4f9b1d7f0b3250be40be58769ff0685c71
4
+ data.tar.gz: 5b993b3c662c18cab4c534ceb7cc7f11f280e07f
5
5
  SHA512:
6
- metadata.gz: d6dbecbb9af05b2ec922bdcd6d0048e959f6ae33cbd7f12b4d4dd03126eb4c0dd510041736a05bfe37a80b9a27a35c3bb7d8b917fdc5e5b9a898db9f046852aa
7
- data.tar.gz: dba6fe0525da1f62224485fb30f17a6f3268666fb27e0d1fa35b5471098a44529d78e38ccd038ed88db46f045aa9b1ac670ce22720b742cc7f071a5cc686ba66
6
+ metadata.gz: bbf218ae097fa2111f0cfc16dc80e1dd2f5216a3d26a961979b99a1ef135bc9c689998cbef62301e2b90d00fa337035e5673c1e9ff940acbd03a3f8c288de812
7
+ data.tar.gz: b6085d119216ab6991140d3b98130b203f7e463b4a4ab4924540efab6846125aef2256b1dec7cb4aa86c88c2e1951bd45573268e570e0d92f83c81e05e84f086
@@ -119,6 +119,11 @@ module Booker
119
119
  )
120
120
  end
121
121
 
122
+ def customer(id:)
123
+ response = get("#{V41_PREFIX}/customer/#{id}", build_params)
124
+ Booker::V4::Models::Customer.from_hash(response)
125
+ end
126
+
122
127
  def create_special(location_id:, start_date:, end_date:, coupon_code:, name:, params: {})
123
128
  post(API_METHODS[:create_special], build_params({
124
129
  LocationID: location_id,
@@ -40,13 +40,9 @@ module Booker
40
40
  'PreferredStaffMemberID',
41
41
  'ReferredByCustomerID'
42
42
 
43
- def self.from_list(array)
44
- if array.any? && array.first['Customer']
45
- flattened = array.map{|a| a['Customer'].merge('CustomerID' => a['CustomerID'])}
46
- super(flattened)
47
- else
48
- super
49
- end
43
+ def self.from_hash(hash)
44
+ return super unless hash['Customer'].is_a?(Hash)
45
+ super(hash['Customer'].merge('CustomerID' => hash['CustomerID']))
50
46
  end
51
47
  end
52
48
  end
@@ -1,3 +1,3 @@
1
1
  module Booker
2
- VERSION = '3.0.4'
2
+ VERSION = '3.0.5'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: booker_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.4
4
+ version: 3.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Frederick
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-06-17 00:00:00.000000000 Z
11
+ date: 2017-06-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty