adf_builder 1.2.1 → 1.2.2
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/CHANGELOG.md +3 -0
- data/Gemfile.lock +1 -1
- data/lib/adf_builder/nodes/vehicle_nodes.rb +13 -0
- data/lib/adf_builder/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f5c6497310cd559356bd6e358243d2dd2ed5d2a859330fe403ae959b32592b0b
|
|
4
|
+
data.tar.gz: 77e66f74d658adc2022d401d85a037549f8f92c91d984c265db337a33c05353c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8aba468994e77c3af346c7f6dccbdd4eed16fd858ccf6206226c90d97a5e1126d75bc5083440d40ce1ac3233d2b6f0395b899fcce70afc76ccba7691867e779f
|
|
7
|
+
data.tar.gz: 215970d63f001f71e21c55651368c9ebab28dafd9e5f26d19519dbff6c897ed4859443623f01d3a99a5c014743d00f8e74b351eda0b371d28e578edc744d5582
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -67,10 +67,21 @@ module AdfBuilder
|
|
|
67
67
|
end
|
|
68
68
|
end
|
|
69
69
|
|
|
70
|
+
# Common ISO 4217 codes (Top valid ones per spec/common usage)
|
|
71
|
+
# Keeping it as a constant for reuse.
|
|
72
|
+
# This list can be expanded but covers major currencies.
|
|
73
|
+
ISO_4217 = %w[
|
|
74
|
+
USD EUR GBP JPY AUD CAD CHF CNY SEK NZD
|
|
75
|
+
MXN SGD HKD NOK KRW TRY RUB INR BRL ZAR
|
|
76
|
+
DKK PLN TWD THB IDR HUF CZK ILS CLP PHP
|
|
77
|
+
AED COP SAR MYR RON PEN VND NGN
|
|
78
|
+
].freeze
|
|
79
|
+
|
|
70
80
|
class Price < Node
|
|
71
81
|
validates_inclusion_of :type, in: %i[quote offer msrp invoice call appraisal asking]
|
|
72
82
|
validates_inclusion_of :delta, in: %i[absolute relative percentage]
|
|
73
83
|
validates_inclusion_of :relativeto, in: %i[msrp invoice]
|
|
84
|
+
validates_inclusion_of :currency, in: ISO_4217
|
|
74
85
|
|
|
75
86
|
def initialize(value, type: :quote, currency: nil, delta: nil, relativeto: nil, source: nil)
|
|
76
87
|
super()
|
|
@@ -87,6 +98,7 @@ module AdfBuilder
|
|
|
87
98
|
class Amount < Node
|
|
88
99
|
validates_inclusion_of :type, in: %i[downpayment monthly total]
|
|
89
100
|
validates_inclusion_of :limit, in: %i[maximum minimum exact]
|
|
101
|
+
validates_inclusion_of :currency, in: ISO_4217
|
|
90
102
|
|
|
91
103
|
def initialize(value, type: :total, limit: :maximum, currency: nil)
|
|
92
104
|
super()
|
|
@@ -100,6 +112,7 @@ module AdfBuilder
|
|
|
100
112
|
|
|
101
113
|
class Balance < Node
|
|
102
114
|
validates_inclusion_of :type, in: %i[finance residual]
|
|
115
|
+
validates_inclusion_of :currency, in: ISO_4217
|
|
103
116
|
|
|
104
117
|
def initialize(value, type: :finance, currency: nil)
|
|
105
118
|
super()
|
data/lib/adf_builder/version.rb
CHANGED