transferzero-sdk 1.26.1 → 1.27.3

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.
Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +5 -4
  3. data/docs/CurrencyExchangeAllOf.md +17 -0
  4. data/docs/CurrencyOppositeAllOf.md +21 -0
  5. data/docs/DocumentWebhookAllOf.md +17 -0
  6. data/docs/PaymentMethodOppositeAllOf.md +17 -0
  7. data/docs/PayoutMethod.md +1 -1
  8. data/docs/PayoutMethodDetails.md +1 -1
  9. data/docs/PayoutMethodDetailsUGXBank.md +33 -0
  10. data/docs/PayoutMethodWebhookAllOf.md +17 -0
  11. data/docs/RecipientWebhookAllOf.md +17 -0
  12. data/docs/SenderWebhookAllOf.md +17 -0
  13. data/docs/TransactionWebhookAllOf.md +17 -0
  14. data/lib/transferzero-sdk/api_client.rb +1 -1
  15. data/lib/transferzero-sdk/models/currency_exchange_all_of.rb +205 -0
  16. data/lib/transferzero-sdk/models/currency_opposite_all_of.rb +223 -0
  17. data/lib/transferzero-sdk/models/document_webhook_all_of.rb +202 -0
  18. data/lib/transferzero-sdk/models/payment_method_opposite_all_of.rb +205 -0
  19. data/lib/transferzero-sdk/models/payout_method.rb +1 -1
  20. data/lib/transferzero-sdk/models/payout_method_bank_account_type_enum.rb +2 -0
  21. data/lib/transferzero-sdk/models/payout_method_details.rb +2 -1
  22. data/lib/transferzero-sdk/models/payout_method_details_ugx_bank.rb +320 -0
  23. data/lib/transferzero-sdk/models/payout_method_webhook_all_of.rb +202 -0
  24. data/lib/transferzero-sdk/models/recipient_webhook_all_of.rb +202 -0
  25. data/lib/transferzero-sdk/models/sender_webhook_all_of.rb +202 -0
  26. data/lib/transferzero-sdk/models/transaction_webhook_all_of.rb +202 -0
  27. data/lib/transferzero-sdk/version.rb +1 -1
  28. data/lib/transferzero-sdk.rb +1 -0
  29. data/spec/models/currency_exchange_all_of_spec.rb +41 -0
  30. data/spec/models/currency_opposite_all_of_spec.rb +53 -0
  31. data/spec/models/document_webhook_all_of_spec.rb +41 -0
  32. data/spec/models/payment_method_opposite_all_of_spec.rb +41 -0
  33. data/spec/models/payout_method_details_ugx_bank_spec.rb +89 -0
  34. data/spec/models/payout_method_webhook_all_of_spec.rb +41 -0
  35. data/spec/models/recipient_webhook_all_of_spec.rb +41 -0
  36. data/spec/models/sender_webhook_all_of_spec.rb +41 -0
  37. data/spec/models/transaction_webhook_all_of_spec.rb +41 -0
  38. data/transferzero-sdk-1.26.1.gem +0 -0
  39. metadata +40 -4
  40. data/Gemfile.lock +0 -88
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5be47f1d203fb10177014dc2010918003221e523276a3699e1e9d59b5ebcd217
4
- data.tar.gz: b8db60c105a52f30acf04920d5f9b319da98c6c07ded7fbeb6836a9ced3db936
3
+ metadata.gz: c026380fbb068eaa6f2fd8cd7d7a4e344703941f4a598a941335a36a876c889c
4
+ data.tar.gz: ec9ebe1444472809fd67eebc74f11f0af6ccbf49f91d5d6873ab0f3bc0c7f0ee
5
5
  SHA512:
6
- metadata.gz: 6f8686dd0191dc016cafc9c142881b320107afcd71b9b7ce9d9120a057a467b5d7f4901f80ee5a27d25740eb4c90ad11e2d6faed2ab54043dabe0065e596890f
7
- data.tar.gz: b03d7cbc46e6e983071d1d8a5a1f169493d93b5afca5d2e5cbf2a9ef048d5e41fcdbdfb7ba0bcc91d7373687dd8edbf7998abbfdf9b5d5171e6f797de44be69d
6
+ metadata.gz: a4f21641dd931824a9a421f9868913cd39c21adc6e1edd6090fe35d63efcc8a3f4b52e4830e661dbf0fae7fc10c8da24d08409b67182bbb0364eb2533c3ac7f9
7
+ data.tar.gz: d00429c962bb5287f416f3e8652d5da454bd67a1e04be944fc7b6b311dbac9987c7903258094b0a1eb95cc7d2969a6d22a12aeac3796f0d3fdab0d69bdf7a44c
data/README.md CHANGED
@@ -7,7 +7,7 @@ Reference documentation for the TransferZero API V1
7
7
  This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
8
8
 
9
9
  - API version: 1.0
10
- - Package version: 1.26.1
10
+ - Package version: 1.27.3
11
11
  - Build package: org.openapitools.codegen.languages.RubyClientCodegen
12
12
 
13
13
  For more information, please visit:
@@ -31,15 +31,15 @@ gem build transferzero-sdk.gemspec
31
31
  Then either install the gem locally:
32
32
 
33
33
  ```shell
34
- gem install ./transferzero-sdk-1.26.1.gem
34
+ gem install ./transferzero-sdk-1.27.3.gem
35
35
  ```
36
- (for development, run `gem install --dev ./transferzero-sdk-1.26.1.gem` to install the development dependencies)
36
+ (for development, run `gem install --dev ./transferzero-sdk-1.27.3.gem` to install the development dependencies)
37
37
 
38
38
  or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
39
39
 
40
40
  Finally add this to the Gemfile:
41
41
 
42
- gem 'transferzero-sdk', '~> 1.26.1'
42
+ gem 'transferzero-sdk', '~> 1.27.3'
43
43
 
44
44
  ### Install from Git
45
45
 
@@ -224,6 +224,7 @@ Class | Method | HTTP request | Description
224
224
  - [TransferZero::PayoutMethodDetailsMobile](docs/PayoutMethodDetailsMobile.md)
225
225
  - [TransferZero::PayoutMethodDetailsNGNBank](docs/PayoutMethodDetailsNGNBank.md)
226
226
  - [TransferZero::PayoutMethodDetailsNZDBank](docs/PayoutMethodDetailsNZDBank.md)
227
+ - [TransferZero::PayoutMethodDetailsUGXBank](docs/PayoutMethodDetailsUGXBank.md)
227
228
  - [TransferZero::PayoutMethodDetailsUSDBank](docs/PayoutMethodDetailsUSDBank.md)
228
229
  - [TransferZero::PayoutMethodDetailsUSDCash](docs/PayoutMethodDetailsUSDCash.md)
229
230
  - [TransferZero::PayoutMethodDetailsXAFBank](docs/PayoutMethodDetailsXAFBank.md)
@@ -0,0 +1,17 @@
1
+ # TransferZero::CurrencyExchangeAllOf
2
+
3
+ ## Properties
4
+
5
+ Name | Type | Description | Notes
6
+ ------------ | ------------- | ------------- | -------------
7
+ **opposites** | [**Array<CurrencyOpposite>**](CurrencyOpposite.md) | Lists the currencies where you can exchange from this one | [optional]
8
+
9
+ ## Code Sample
10
+
11
+ ```ruby
12
+ require 'TransferZero'
13
+
14
+ instance = TransferZero::CurrencyExchangeAllOf.new(opposites: null)
15
+ ```
16
+
17
+
@@ -0,0 +1,21 @@
1
+ # TransferZero::CurrencyOppositeAllOf
2
+
3
+ ## Properties
4
+
5
+ Name | Type | Description | Notes
6
+ ------------ | ------------- | ------------- | -------------
7
+ **rate** | **Float** | The rate of this particular currency with the base one | [optional]
8
+ **mtm_rate** | **Float** | Mark to market rate of this particular currency against the base one with the margin factored in | [optional]
9
+ **margin** | **String** | The margin set for transactions of this particular currency with the base one | [optional]
10
+
11
+ ## Code Sample
12
+
13
+ ```ruby
14
+ require 'TransferZero'
15
+
16
+ instance = TransferZero::CurrencyOppositeAllOf.new(rate: null,
17
+ mtm_rate: null,
18
+ margin: null)
19
+ ```
20
+
21
+
@@ -0,0 +1,17 @@
1
+ # TransferZero::DocumentWebhookAllOf
2
+
3
+ ## Properties
4
+
5
+ Name | Type | Description | Notes
6
+ ------------ | ------------- | ------------- | -------------
7
+ **object** | [**Document**](Document.md) | | [optional]
8
+
9
+ ## Code Sample
10
+
11
+ ```ruby
12
+ require 'TransferZero'
13
+
14
+ instance = TransferZero::DocumentWebhookAllOf.new(object: null)
15
+ ```
16
+
17
+
@@ -0,0 +1,17 @@
1
+ # TransferZero::PaymentMethodOppositeAllOf
2
+
3
+ ## Properties
4
+
5
+ Name | Type | Description | Notes
6
+ ------------ | ------------- | ------------- | -------------
7
+ **opposites** | [**Array<PaymentMethod>**](PaymentMethod.md) | List of all providers that can be used in conjunction with the main provider | [optional]
8
+
9
+ ## Code Sample
10
+
11
+ ```ruby
12
+ require 'TransferZero'
13
+
14
+ instance = TransferZero::PaymentMethodOppositeAllOf.new(opposites: null)
15
+ ```
16
+
17
+
data/docs/PayoutMethod.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  Name | Type | Description | Notes
6
6
  ------------ | ------------- | ------------- | -------------
7
- **type** | **String** | Contains the currency to send the money to, and the type of the money movement Commonly used payout types are: - `NGN::Bank` - for Nigerian bank account payments. - `GHS::Bank` - for Ghanaian bank account payments. - `GHS::Mobile` - for Ghanaian mobile money payments. - `GHS::Cash` - for Ghanaian cash remittance payments. - `UGX::Mobile` - for Ugandan mobile money payments. - `XOF::Mobile` - for mobile money payments to West-Africa. - `XOF::Bank` - for Senegalese bank account payments. - `XOF::Cash` - for Senegalese cash remittance payments. - `MAD::Cash` - for Moroccan cash remittance payments. - `EUR::Bank` - for IBAN bank transfers in EUR. - `GBP::Bank` - for IBAN bank and FP accounts transfers in GBP. - `ZAR::Bank` - for South Africa bank account payments. - `USD::Bank` - for USD account payments. *** Currently Nigeria & United States only and in Beta phase *** - `USD::Cash` - for USD cash remittance payments. *** Currently Nigeria only and in Beta phase *** - `KES::Bank` - for Kenyan bank account payments. - `KES::Mobile` - for Kenyan mobile money payments. - `XAF::Mobile` - for mobile money payments to Cameroon. - `XAF::Bank` - for Cameroon bank account payments.. - `GNF::Mobile` - for mobile money payments to Guinea. - `BRL::Bank` - for Brazilian bank account payments. - `NZD::Bank` - for New Zealand bank account payments. - `INR::Bank` - for Indian bank account payments. - `BWP::Bank` - for Botswana bank account payments. - `ZMW::Bank` - for Zambian bank account payments. - `CAD::Bank` - for Canadian bank account payments You can also send funds to the internal balance using `CCY::Balance`, where `CCY` is the appropriate currency. See [Collection from senders](https://docs.transferzero.com/docs/additional-features/#collections-from-senders) for more info on how to collect money into internal balance | [optional]
7
+ **type** | **String** | Contains the currency to send the money to, and the type of the money movement Commonly used payout types are: - `NGN::Bank` - for Nigerian bank account payments. - `GHS::Bank` - for Ghanaian bank account payments. - `GHS::Mobile` - for Ghanaian mobile money payments. - `GHS::Cash` - for Ghanaian cash remittance payments. - `UGX::Mobile` - for Ugandan mobile money payments. - `XOF::Mobile` - for mobile money payments to West-Africa. - `XOF::Bank` - for Senegalese bank account payments. - `XOF::Cash` - for Senegalese cash remittance payments. - `MAD::Cash` - for Moroccan cash remittance payments. - `EUR::Bank` - for IBAN bank transfers in EUR. - `GBP::Bank` - for IBAN bank and FP accounts transfers in GBP. - `ZAR::Bank` - for South Africa bank account payments. - `USD::Bank` - for USD account payments. *** Currently Nigeria & United States only and in Beta phase *** - `USD::Cash` - for USD cash remittance payments. *** Currently Nigeria only and in Beta phase *** - `KES::Bank` - for Kenyan bank account payments. - `KES::Mobile` - for Kenyan mobile money payments. - `XAF::Mobile` - for mobile money payments to Cameroon. - `XAF::Bank` - for Cameroon bank account payments.. - `GNF::Mobile` - for mobile money payments to Guinea. - `BRL::Bank` - for Brazilian bank account payments. - `NZD::Bank` - for New Zealand bank account payments. - `INR::Bank` - for Indian bank account payments. - `BWP::Bank` - for Botswana bank account payments. - `ZMW::Bank` - for Zambian bank account payments. - `CAD::Bank` - for Canadian bank account payments. - `UGX::Bank` - for Ugandan bank account payments. You can also send funds to the internal balance using `CCY::Balance`, where `CCY` is the appropriate currency. See [Collection from senders](https://docs.transferzero.com/docs/additional-features/#collections-from-senders) for more info on how to collect money into internal balance | [optional]
8
8
  **details** | [**PayoutMethodDetails**](PayoutMethodDetails.md) | | [optional]
9
9
  **metadata** | [**Object**](.md) | Metadata of payout method. You can store any kind of information in this field. | [optional]
10
10
  **id** | **String** | | [optional]
@@ -12,7 +12,7 @@ Name | Type | Description | Notes
12
12
  **phone_number** | **String** | |
13
13
  **mobile_provider** | [**PayoutMethodMobileProviderEnum**](PayoutMethodMobileProviderEnum.md) | |
14
14
  **country** | [**PayoutMethodCountryEnum**](PayoutMethodCountryEnum.md) | |
15
- **transfer_reason** | [**PayoutMethodTransferReasonEnum**](PayoutMethodTransferReasonEnum.md) | |
15
+ **transfer_reason** | **String** | |
16
16
  **iban** | **String** | |
17
17
  **bank_name** | **String** | |
18
18
  **bank_country** | **String** | | [optional]
@@ -0,0 +1,33 @@
1
+ # TransferZero::PayoutMethodDetailsUGXBank
2
+
3
+ ## Properties
4
+
5
+ Name | Type | Description | Notes
6
+ ------------ | ------------- | ------------- | -------------
7
+ **first_name** | **String** | |
8
+ **last_name** | **String** | |
9
+ **street** | **String** | |
10
+ **city** | **String** | |
11
+ **postal_code** | **String** | |
12
+ **identity_card_id** | **String** | |
13
+ **bank_account** | **String** | |
14
+ **branch_code** | **String** | |
15
+ **transfer_reason** | **String** | |
16
+
17
+ ## Code Sample
18
+
19
+ ```ruby
20
+ require 'TransferZero'
21
+
22
+ instance = TransferZero::PayoutMethodDetailsUGXBank.new(first_name: null,
23
+ last_name: null,
24
+ street: null,
25
+ city: null,
26
+ postal_code: null,
27
+ identity_card_id: null,
28
+ bank_account: null,
29
+ branch_code: null,
30
+ transfer_reason: null)
31
+ ```
32
+
33
+
@@ -0,0 +1,17 @@
1
+ # TransferZero::PayoutMethodWebhookAllOf
2
+
3
+ ## Properties
4
+
5
+ Name | Type | Description | Notes
6
+ ------------ | ------------- | ------------- | -------------
7
+ **object** | [**PayoutMethod**](PayoutMethod.md) | | [optional]
8
+
9
+ ## Code Sample
10
+
11
+ ```ruby
12
+ require 'TransferZero'
13
+
14
+ instance = TransferZero::PayoutMethodWebhookAllOf.new(object: null)
15
+ ```
16
+
17
+
@@ -0,0 +1,17 @@
1
+ # TransferZero::RecipientWebhookAllOf
2
+
3
+ ## Properties
4
+
5
+ Name | Type | Description | Notes
6
+ ------------ | ------------- | ------------- | -------------
7
+ **object** | [**Recipient**](Recipient.md) | | [optional]
8
+
9
+ ## Code Sample
10
+
11
+ ```ruby
12
+ require 'TransferZero'
13
+
14
+ instance = TransferZero::RecipientWebhookAllOf.new(object: null)
15
+ ```
16
+
17
+
@@ -0,0 +1,17 @@
1
+ # TransferZero::SenderWebhookAllOf
2
+
3
+ ## Properties
4
+
5
+ Name | Type | Description | Notes
6
+ ------------ | ------------- | ------------- | -------------
7
+ **object** | [**Sender**](Sender.md) | | [optional]
8
+
9
+ ## Code Sample
10
+
11
+ ```ruby
12
+ require 'TransferZero'
13
+
14
+ instance = TransferZero::SenderWebhookAllOf.new(object: null)
15
+ ```
16
+
17
+
@@ -0,0 +1,17 @@
1
+ # TransferZero::TransactionWebhookAllOf
2
+
3
+ ## Properties
4
+
5
+ Name | Type | Description | Notes
6
+ ------------ | ------------- | ------------- | -------------
7
+ **object** | [**Transaction**](Transaction.md) | | [optional]
8
+
9
+ ## Code Sample
10
+
11
+ ```ruby
12
+ require 'TransferZero'
13
+
14
+ instance = TransferZero::TransactionWebhookAllOf.new(object: null)
15
+ ```
16
+
17
+
@@ -36,7 +36,7 @@ module TransferZero
36
36
  # @option config [Configuration] Configuration for initializing the object, default to Configuration.default
37
37
  def initialize(config = Configuration.default)
38
38
  @config = config
39
- @user_agent = "TransferZero-SDK/Ruby/1.26.1"
39
+ @user_agent = "TransferZero-SDK/Ruby/1.27.3"
40
40
  @default_headers = {
41
41
  'Content-Type' => 'application/json',
42
42
  'User-Agent' => @user_agent
@@ -0,0 +1,205 @@
1
+ =begin
2
+ #TransferZero API
3
+
4
+ #Reference documentation for the TransferZero API V1
5
+
6
+ OpenAPI spec version: 1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.0.0-beta3
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module TransferZero
16
+ class CurrencyExchangeAllOf
17
+ # Lists the currencies where you can exchange from this one
18
+ attr_accessor :opposites
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'opposites' => :'opposites'
24
+ }
25
+ end
26
+
27
+ # Attribute type mapping.
28
+ def self.openapi_types
29
+ {
30
+ :'opposites' => :'Array<CurrencyOpposite>'
31
+ }
32
+ end
33
+
34
+ # Initializes the object
35
+ # @param [Hash] attributes Model attributes in the form of hash
36
+ def initialize(attributes = {})
37
+ if (!attributes.is_a?(Hash))
38
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TransferZero::CurrencyExchangeAllOf` initialize method"
39
+ end
40
+
41
+ # check to see if the attribute exists and convert string to symbol for hash key
42
+ attributes = attributes.each_with_object({}) { |(k, v), h|
43
+ if (!self.class.attribute_map.key?(k.to_sym))
44
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TransferZero::CurrencyExchangeAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
45
+ end
46
+ h[k.to_sym] = v
47
+ }
48
+
49
+ if attributes.key?(:'opposites')
50
+ if (value = attributes[:'opposites']).is_a?(Array)
51
+ self.opposites = value
52
+ end
53
+ end
54
+ end
55
+
56
+ # Show invalid properties with the reasons. Usually used together with valid?
57
+ # @return Array for valid properties with the reasons
58
+ def list_invalid_properties
59
+ invalid_properties = Array.new
60
+ invalid_properties
61
+ end
62
+
63
+ # Check to see if the all the properties in the model are valid
64
+ # @return true if the model is valid
65
+ def valid?
66
+ true
67
+ end
68
+
69
+ # Checks equality by comparing each attribute.
70
+ # @param [Object] Object to be compared
71
+ def ==(o)
72
+ return true if self.equal?(o)
73
+ self.class == o.class &&
74
+ opposites == o.opposites
75
+ end
76
+
77
+ # @see the `==` method
78
+ # @param [Object] Object to be compared
79
+ def eql?(o)
80
+ self == o
81
+ end
82
+
83
+ # Calculates hash code according to all attributes.
84
+ # @return [Integer] Hash code
85
+ def hash
86
+ [opposites].hash
87
+ end
88
+
89
+ require 'active_support/core_ext/hash'
90
+ require 'active_support/hash_with_indifferent_access.rb'
91
+ # Builds the object from hash
92
+ # @param [Hash] attributes Model attributes in the form of hash
93
+ # @return [Object] Returns the model itself
94
+ def build_from_hash(attributes)
95
+ return nil unless attributes.is_a?(Hash)
96
+ self.class.openapi_types.each_pair do |key, type|
97
+ if type =~ /\AArray<(.*)>/i
98
+ # check to ensure the input is an array given that the the attribute
99
+ # is documented as an array but the input is not
100
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
101
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
102
+ end
103
+ elsif !attributes[self.class.attribute_map[key]].nil?
104
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
105
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
106
+ end
107
+
108
+ self
109
+ end
110
+
111
+ # Deserializes the data based on type
112
+ # @param string type Data type
113
+ # @param string value Value to be deserialized
114
+ # @return [Object] Deserialized data
115
+ def _deserialize(type, value)
116
+ case type.to_sym
117
+ when :DateTime
118
+ DateTime.parse(value)
119
+ when :Date
120
+ Date.parse(value)
121
+ when :String
122
+ value.to_s
123
+ when :Integer
124
+ value.to_i
125
+ when :Float
126
+ value.to_f
127
+ when :Boolean
128
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
129
+ true
130
+ else
131
+ false
132
+ end
133
+ when :Object
134
+ # generic object (usually a Hash), return directly
135
+ value
136
+ when /\AArray<(?<inner_type>.+)>\z/
137
+ inner_type = Regexp.last_match[:inner_type]
138
+ value.map { |v| _deserialize(inner_type, v) }
139
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
140
+ k_type = Regexp.last_match[:k_type]
141
+ v_type = Regexp.last_match[:v_type]
142
+ {}.tap do |hash|
143
+ value.each do |k, v|
144
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
145
+ end
146
+ end
147
+ else # model
148
+ temp_model = TransferZero.const_get(type).new
149
+ temp_model.build_from_hash(value)
150
+ end
151
+ end
152
+
153
+ # Returns the string representation of the object
154
+ # @return [String] String presentation of the object
155
+ def to_s
156
+ to_hash.to_s
157
+ end
158
+
159
+ # to_body is an alias to to_hash (backward compatibility)
160
+ # @return [Hash] Returns the object in the form of hash
161
+ def to_body
162
+ to_hash
163
+ end
164
+
165
+ # Returns the object in the form of hash
166
+ # @return [Hash] Returns the object in the form of hash
167
+ def to_hash
168
+ hash = {}
169
+ self.class.attribute_map.each_pair do |attr, param|
170
+ value = self.send(attr)
171
+ next if value.nil?
172
+ hash[param] = _to_hash(value)
173
+ end
174
+ ::ActiveSupport::HashWithIndifferentAccess.new(hash)
175
+ end
176
+
177
+ def [](key)
178
+ to_hash[key]
179
+ end
180
+
181
+ def dig(*args)
182
+ to_hash.dig(*args)
183
+ end
184
+
185
+ # Outputs non-array value in the form of hash
186
+ # For object, use to_hash. Otherwise, just return the value
187
+ # @param [Object] value Any valid value
188
+ # @return [Hash] Returns the value in the form of hash
189
+ def _to_hash(value)
190
+ if value.is_a?(Array)
191
+ value.compact.map { |v| _to_hash(v) }
192
+ elsif value.is_a?(Hash)
193
+ {}.tap do |hash|
194
+ value.each { |k, v| hash[k] = _to_hash(v) }
195
+ end
196
+ elsif value.respond_to? :to_hash
197
+ value.to_hash
198
+ else
199
+ value
200
+ end
201
+ end
202
+
203
+ end
204
+
205
+ end