cadooz 2.1.1 → 2.2.1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c8e774b7abba9073caff04664a3af8c1fb3dfd97
|
4
|
+
data.tar.gz: aa6f662004d7898778846fba80d9ba98da0ec389
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0f04556e1ee2490c189670553d67d6832ce64819fe8c05dad3bfbd5cfb1e2a75064a60004b54d4ce2d50d855fff01a75ae7b059e2354c4e82e6879e4128c04a2
|
7
|
+
data.tar.gz: 5151d3f1adefabbc6d568b42c3a81e55f3282761107ae6b7fc4cc432ebe6c3590029ee61e35dd8dfcae350fb83b48e9ceae49bf6319030e0a7027f737e6ad84e
|
data/lib/cadooz.rb
CHANGED
@@ -48,8 +48,9 @@ require_relative 'cadooz/models/immutable/order_position'
|
|
48
48
|
require_relative 'cadooz/models/immutable/order_status'
|
49
49
|
require_relative 'cadooz/models/immutable/payment'
|
50
50
|
require_relative 'cadooz/models/immutable/product_category'
|
51
|
-
require_relative 'cadooz/models/immutable/response
|
51
|
+
require_relative 'cadooz/models/immutable/response'
|
52
52
|
require_relative 'cadooz/models/immutable/voucher'
|
53
|
+
require_relative 'cadooz/models/immutable/voucher_information'
|
53
54
|
require_relative 'cadooz/models/mutable/address'
|
54
55
|
require_relative 'cadooz/models/mutable/greeting_card'
|
55
56
|
require_relative 'cadooz/models/mutable/invoice_information'
|
@@ -16,7 +16,7 @@ class Cadooz::Immutable::Voucher
|
|
16
16
|
@product_number = open_struct&.product_number
|
17
17
|
@product_variation_number = open_struct&.product_variation_number
|
18
18
|
@serial_number = open_struct&.serial_number
|
19
|
-
@value =
|
19
|
+
@value = open_struct&.value.to_f
|
20
20
|
|
21
21
|
self.freeze
|
22
22
|
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
class Cadooz::Immutable::VoucherInformation
|
2
|
+
include Mixins
|
3
|
+
|
4
|
+
attr_reader :response_state, :voucher_list
|
5
|
+
|
6
|
+
def initialize(open_struct)
|
7
|
+
@response_state = open_struct&.response_state
|
8
|
+
@voucher_list = Array(open_struct&.voucher_list)&.each_with_object([]) { |v, arr| arr << Cadooz::Immutable::Voucher.new(v) }
|
9
|
+
|
10
|
+
self.freeze
|
11
|
+
end
|
12
|
+
end
|
@@ -108,7 +108,7 @@ class Cadooz::BusinessOrderService
|
|
108
108
|
# Returns:
|
109
109
|
# A VoucherInformation object. Never null.
|
110
110
|
def get_vouchers_for_order(generation_profile_name = Cadooz.configuration.generation_profile, order_number)
|
111
|
-
response_class = Cadooz::Immutable::
|
111
|
+
response_class = Cadooz::Immutable::VoucherInformation
|
112
112
|
|
113
113
|
deserialize(@call.(__callee__, {generation_profile_name: generation_profile_name, order_number: order_number }), response_class, __callee__)
|
114
114
|
end
|
data/lib/cadooz/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cadooz
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Brown
|
@@ -80,6 +80,7 @@ files:
|
|
80
80
|
- lib/cadooz/models/immutable/product_category.rb
|
81
81
|
- lib/cadooz/models/immutable/response.rb
|
82
82
|
- lib/cadooz/models/immutable/voucher.rb
|
83
|
+
- lib/cadooz/models/immutable/voucher_information.rb
|
83
84
|
- lib/cadooz/models/mutable/address.rb
|
84
85
|
- lib/cadooz/models/mutable/greeting_card.rb
|
85
86
|
- lib/cadooz/models/mutable/invoice_information.rb
|