ultracart_api 3.10.14 → 3.10.17

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +49 -97
  3. data/docs/ChannelPartnerApi.md +51 -0
  4. data/docs/{DelayAutoOrdersResponse.md → ChannelPartnerEstimateTaxResponse.md} +2 -2
  5. data/lib/ultracart_api/api/channel_partner_api.rb +55 -0
  6. data/lib/ultracart_api/models/{stripe_connect_response.rb → channel_partner_estimate_tax_response.rb} +8 -8
  7. data/lib/ultracart_api/version.rb +1 -1
  8. data/lib/ultracart_api.rb +1 -39
  9. metadata +4 -80
  10. data/docs/ConfigurationApi.md +0 -756
  11. data/docs/PaymentsConfiguration.md +0 -24
  12. data/docs/PaymentsConfigurationAffirm.md +0 -15
  13. data/docs/PaymentsConfigurationAmazon.md +0 -15
  14. data/docs/PaymentsConfigurationCOD.md +0 -13
  15. data/docs/PaymentsConfigurationCash.md +0 -9
  16. data/docs/PaymentsConfigurationCheck.md +0 -19
  17. data/docs/PaymentsConfigurationCreditCard.md +0 -17
  18. data/docs/PaymentsConfigurationCreditCardType.md +0 -18
  19. data/docs/PaymentsConfigurationEcheck.md +0 -12
  20. data/docs/PaymentsConfigurationInsurance.md +0 -9
  21. data/docs/PaymentsConfigurationLoanHero.md +0 -12
  22. data/docs/PaymentsConfigurationMoneyOrder.md +0 -11
  23. data/docs/PaymentsConfigurationPayPal.md +0 -36
  24. data/docs/PaymentsConfigurationPurchaseOrder.md +0 -11
  25. data/docs/PaymentsConfigurationQuoteRequest.md +0 -10
  26. data/docs/PaymentsConfigurationResponse.md +0 -12
  27. data/docs/PaymentsConfigurationRestrictions.md +0 -21
  28. data/docs/PaymentsConfigurationRestrictionsTheme.md +0 -10
  29. data/docs/PaymentsConfigurationSezzle.md +0 -15
  30. data/docs/PaymentsConfigurationTestMethod.md +0 -18
  31. data/docs/PaymentsConfigurationWePay.md +0 -35
  32. data/docs/PaymentsConfigurationWireTransfer.md +0 -18
  33. data/docs/PaymentsThemeTransactionType.md +0 -10
  34. data/docs/PaymentsWepayEnroll.md +0 -22
  35. data/docs/RotatingTransactionGateway.md +0 -51
  36. data/docs/RotatingTransactionGatewayResponse.md +0 -12
  37. data/docs/RotatingTransactionGatewaysResponse.md +0 -12
  38. data/docs/RtgCurrency.md +0 -10
  39. data/docs/RtgDayOfMonthRestriction.md +0 -9
  40. data/docs/RtgDayOfWeekRestriction.md +0 -10
  41. data/docs/RtgSummaryGateway.md +0 -24
  42. data/docs/RtgSummaryResponse.md +0 -14
  43. data/docs/RtgThemeRestriction.md +0 -10
  44. data/docs/StripeConnectResponse.md +0 -12
  45. data/docs/TransactionGateway.md +0 -71
  46. data/docs/TransactionGatewaysRequest.md +0 -10
  47. data/docs/TransactionGatewaysResponse.md +0 -12
  48. data/lib/ultracart_api/api/configuration_api.rb +0 -843
  49. data/lib/ultracart_api/models/delay_auto_orders_response.rb +0 -221
  50. data/lib/ultracart_api/models/payments_configuration.rb +0 -329
  51. data/lib/ultracart_api/models/payments_configuration_affirm.rb +0 -288
  52. data/lib/ultracart_api/models/payments_configuration_amazon.rb +0 -288
  53. data/lib/ultracart_api/models/payments_configuration_cash.rb +0 -194
  54. data/lib/ultracart_api/models/payments_configuration_check.rb +0 -294
  55. data/lib/ultracart_api/models/payments_configuration_cod.rb +0 -234
  56. data/lib/ultracart_api/models/payments_configuration_credit_card.rb +0 -279
  57. data/lib/ultracart_api/models/payments_configuration_credit_card_type.rb +0 -318
  58. data/lib/ultracart_api/models/payments_configuration_echeck.rb +0 -226
  59. data/lib/ultracart_api/models/payments_configuration_insurance.rb +0 -194
  60. data/lib/ultracart_api/models/payments_configuration_loan_hero.rb +0 -224
  61. data/lib/ultracart_api/models/payments_configuration_money_order.rb +0 -214
  62. data/lib/ultracart_api/models/payments_configuration_pay_pal.rb +0 -534
  63. data/lib/ultracart_api/models/payments_configuration_purchase_order.rb +0 -214
  64. data/lib/ultracart_api/models/payments_configuration_quote_request.rb +0 -204
  65. data/lib/ultracart_api/models/payments_configuration_response.rb +0 -221
  66. data/lib/ultracart_api/models/payments_configuration_restrictions.rb +0 -447
  67. data/lib/ultracart_api/models/payments_configuration_restrictions_theme.rb +0 -202
  68. data/lib/ultracart_api/models/payments_configuration_sezzle.rb +0 -288
  69. data/lib/ultracart_api/models/payments_configuration_test_method.rb +0 -319
  70. data/lib/ultracart_api/models/payments_configuration_we_pay.rb +0 -454
  71. data/lib/ultracart_api/models/payments_configuration_wire_transfer.rb +0 -284
  72. data/lib/ultracart_api/models/payments_theme_transaction_type.rb +0 -239
  73. data/lib/ultracart_api/models/payments_wepay_enroll.rb +0 -310
  74. data/lib/ultracart_api/models/rotating_transaction_gateway.rb +0 -675
  75. data/lib/ultracart_api/models/rotating_transaction_gateway_response.rb +0 -221
  76. data/lib/ultracart_api/models/rotating_transaction_gateways_response.rb +0 -223
  77. data/lib/ultracart_api/models/rtg_currency.rb +0 -205
  78. data/lib/ultracart_api/models/rtg_day_of_month_restriction.rb +0 -195
  79. data/lib/ultracart_api/models/rtg_day_of_week_restriction.rb +0 -205
  80. data/lib/ultracart_api/models/rtg_summary_gateway.rb +0 -329
  81. data/lib/ultracart_api/models/rtg_summary_response.rb +0 -240
  82. data/lib/ultracart_api/models/rtg_theme_restriction.rb +0 -239
  83. data/lib/ultracart_api/models/transaction_gateway.rb +0 -823
  84. data/lib/ultracart_api/models/transaction_gateways_request.rb +0 -242
  85. data/lib/ultracart_api/models/transaction_gateways_response.rb +0 -223
@@ -1,234 +0,0 @@
1
- =begin
2
- #UltraCart Rest API V2
3
-
4
- #UltraCart REST API Version 2
5
-
6
- OpenAPI spec version: 2.0.0
7
- Contact: support@ultracart.com
8
- Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.4.15-SNAPSHOT
10
-
11
- =end
12
-
13
- require 'date'
14
-
15
- module UltracartClient
16
- class PaymentsConfigurationCOD
17
- # Master flag indicating this merchant accepts COD
18
- attr_accessor :accept_cod
19
-
20
- # If true, only approved customers may pay with COD
21
- attr_accessor :approved_customers_only
22
-
23
- attr_accessor :restrictions
24
-
25
- # Optional field, if surcharge is set, this is the accounting code the surcharge is tagged with when sent to Quickbooks
26
- attr_accessor :surcharge_accounting_code
27
-
28
- # Additional cost for using COD
29
- attr_accessor :surcharge_fee
30
-
31
- # Additional percentage cost for using COD
32
- attr_accessor :surcharge_percentage
33
-
34
- # Attribute mapping from ruby-style variable name to JSON key.
35
- def self.attribute_map
36
- {
37
- :'accept_cod' => :'accept_cod',
38
- :'approved_customers_only' => :'approved_customers_only',
39
- :'restrictions' => :'restrictions',
40
- :'surcharge_accounting_code' => :'surcharge_accounting_code',
41
- :'surcharge_fee' => :'surcharge_fee',
42
- :'surcharge_percentage' => :'surcharge_percentage'
43
- }
44
- end
45
-
46
- # Attribute type mapping.
47
- def self.swagger_types
48
- {
49
- :'accept_cod' => :'BOOLEAN',
50
- :'approved_customers_only' => :'BOOLEAN',
51
- :'restrictions' => :'PaymentsConfigurationRestrictions',
52
- :'surcharge_accounting_code' => :'String',
53
- :'surcharge_fee' => :'Float',
54
- :'surcharge_percentage' => :'Float'
55
- }
56
- end
57
-
58
- # Initializes the object
59
- # @param [Hash] attributes Model attributes in the form of hash
60
- def initialize(attributes = {})
61
- return unless attributes.is_a?(Hash)
62
-
63
- # convert string to symbol for hash key
64
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
65
-
66
- if attributes.has_key?(:'accept_cod')
67
- self.accept_cod = attributes[:'accept_cod']
68
- end
69
-
70
- if attributes.has_key?(:'approved_customers_only')
71
- self.approved_customers_only = attributes[:'approved_customers_only']
72
- end
73
-
74
- if attributes.has_key?(:'restrictions')
75
- self.restrictions = attributes[:'restrictions']
76
- end
77
-
78
- if attributes.has_key?(:'surcharge_accounting_code')
79
- self.surcharge_accounting_code = attributes[:'surcharge_accounting_code']
80
- end
81
-
82
- if attributes.has_key?(:'surcharge_fee')
83
- self.surcharge_fee = attributes[:'surcharge_fee']
84
- end
85
-
86
- if attributes.has_key?(:'surcharge_percentage')
87
- self.surcharge_percentage = attributes[:'surcharge_percentage']
88
- end
89
- end
90
-
91
- # Show invalid properties with the reasons. Usually used together with valid?
92
- # @return Array for valid properties with the reasons
93
- def list_invalid_properties
94
- invalid_properties = Array.new
95
- invalid_properties
96
- end
97
-
98
- # Check to see if the all the properties in the model are valid
99
- # @return true if the model is valid
100
- def valid?
101
- true
102
- end
103
-
104
- # Checks equality by comparing each attribute.
105
- # @param [Object] Object to be compared
106
- def ==(o)
107
- return true if self.equal?(o)
108
- self.class == o.class &&
109
- accept_cod == o.accept_cod &&
110
- approved_customers_only == o.approved_customers_only &&
111
- restrictions == o.restrictions &&
112
- surcharge_accounting_code == o.surcharge_accounting_code &&
113
- surcharge_fee == o.surcharge_fee &&
114
- surcharge_percentage == o.surcharge_percentage
115
- end
116
-
117
- # @see the `==` method
118
- # @param [Object] Object to be compared
119
- def eql?(o)
120
- self == o
121
- end
122
-
123
- # Calculates hash code according to all attributes.
124
- # @return [Fixnum] Hash code
125
- def hash
126
- [accept_cod, approved_customers_only, restrictions, surcharge_accounting_code, surcharge_fee, surcharge_percentage].hash
127
- end
128
-
129
- # Builds the object from hash
130
- # @param [Hash] attributes Model attributes in the form of hash
131
- # @return [Object] Returns the model itself
132
- def build_from_hash(attributes)
133
- return nil unless attributes.is_a?(Hash)
134
- self.class.swagger_types.each_pair do |key, type|
135
- if type =~ /\AArray<(.*)>/i
136
- # check to ensure the input is an array given that the attribute
137
- # is documented as an array but the input is not
138
- if attributes[self.class.attribute_map[key]].is_a?(Array)
139
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
140
- end
141
- elsif !attributes[self.class.attribute_map[key]].nil?
142
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
143
- end # or else data not found in attributes(hash), not an issue as the data can be optional
144
- end
145
-
146
- self
147
- end
148
-
149
- # Deserializes the data based on type
150
- # @param string type Data type
151
- # @param string value Value to be deserialized
152
- # @return [Object] Deserialized data
153
- def _deserialize(type, value)
154
- case type.to_sym
155
- when :DateTime
156
- DateTime.parse(value)
157
- when :Date
158
- Date.parse(value)
159
- when :String
160
- value.to_s
161
- when :Integer
162
- value.to_i
163
- when :Float
164
- value.to_f
165
- when :BOOLEAN
166
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
167
- true
168
- else
169
- false
170
- end
171
- when :Object
172
- # generic object (usually a Hash), return directly
173
- value
174
- when /\AArray<(?<inner_type>.+)>\z/
175
- inner_type = Regexp.last_match[:inner_type]
176
- value.map { |v| _deserialize(inner_type, v) }
177
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
178
- k_type = Regexp.last_match[:k_type]
179
- v_type = Regexp.last_match[:v_type]
180
- {}.tap do |hash|
181
- value.each do |k, v|
182
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
183
- end
184
- end
185
- else # model
186
- temp_model = UltracartClient.const_get(type).new
187
- temp_model.build_from_hash(value)
188
- end
189
- end
190
-
191
- # Returns the string representation of the object
192
- # @return [String] String presentation of the object
193
- def to_s
194
- to_hash.to_s
195
- end
196
-
197
- # to_body is an alias to to_hash (backward compatibility)
198
- # @return [Hash] Returns the object in the form of hash
199
- def to_body
200
- to_hash
201
- end
202
-
203
- # Returns the object in the form of hash
204
- # @return [Hash] Returns the object in the form of hash
205
- def to_hash
206
- hash = {}
207
- self.class.attribute_map.each_pair do |attr, param|
208
- value = self.send(attr)
209
- next if value.nil?
210
- hash[param] = _to_hash(value)
211
- end
212
- hash
213
- end
214
-
215
- # Outputs non-array value in the form of hash
216
- # For object, use to_hash. Otherwise, just return the value
217
- # @param [Object] value Any valid value
218
- # @return [Hash] Returns the value in the form of hash
219
- def _to_hash(value)
220
- if value.is_a?(Array)
221
- value.compact.map { |v| _to_hash(v) }
222
- elsif value.is_a?(Hash)
223
- {}.tap do |hash|
224
- value.each { |k, v| hash[k] = _to_hash(v) }
225
- end
226
- elsif value.respond_to? :to_hash
227
- value.to_hash
228
- else
229
- value
230
- end
231
- end
232
-
233
- end
234
- end
@@ -1,279 +0,0 @@
1
- =begin
2
- #UltraCart Rest API V2
3
-
4
- #UltraCart REST API Version 2
5
-
6
- OpenAPI spec version: 2.0.0
7
- Contact: support@ultracart.com
8
- Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.4.15-SNAPSHOT
10
-
11
- =end
12
-
13
- require 'date'
14
-
15
- module UltracartClient
16
- class PaymentsConfigurationCreditCard
17
- # Master flag indicating whether this merchant accepts credit card payments
18
- attr_accessor :accept_credit_card
19
-
20
- # Description that appears on customer statements
21
- attr_accessor :billed_by
22
-
23
- # If false, order will be accepted and placed into Accounts Receivable without charging card first
24
- attr_accessor :charge_during_checkout
25
-
26
- # UltraCart will require customer to enter cvv if this is true
27
- attr_accessor :collect_cvv2
28
-
29
- # Human readable description of the credit card gateway currently configured
30
- attr_accessor :configured_gateway_details
31
-
32
- # The number of failed attempts before the order is placed into Accounts Receivable for manual intervention
33
- attr_accessor :failed_attempts
34
-
35
- # This internal flag aids the UI in determining which buttons to show.
36
- attr_accessor :hide_connect_single_gateway
37
-
38
- # UltraCart will send customers emails to update their credit card if the card is declined
39
- attr_accessor :send_customer_billing_update_on_decline
40
-
41
- # A list of credit cards the merchant wishes to accept.
42
- attr_accessor :supported_cards
43
-
44
- # An array of test methods for placing test orders. The cards defined here may be real or fake, but any order placed with them will be marked as Test orders
45
- attr_accessor :test_methods
46
-
47
- # Attribute mapping from ruby-style variable name to JSON key.
48
- def self.attribute_map
49
- {
50
- :'accept_credit_card' => :'accept_credit_card',
51
- :'billed_by' => :'billed_by',
52
- :'charge_during_checkout' => :'charge_during_checkout',
53
- :'collect_cvv2' => :'collect_cvv2',
54
- :'configured_gateway_details' => :'configured_gateway_details',
55
- :'failed_attempts' => :'failed_attempts',
56
- :'hide_connect_single_gateway' => :'hide_connect_single_gateway',
57
- :'send_customer_billing_update_on_decline' => :'send_customer_billing_update_on_decline',
58
- :'supported_cards' => :'supported_cards',
59
- :'test_methods' => :'test_methods'
60
- }
61
- end
62
-
63
- # Attribute type mapping.
64
- def self.swagger_types
65
- {
66
- :'accept_credit_card' => :'BOOLEAN',
67
- :'billed_by' => :'String',
68
- :'charge_during_checkout' => :'BOOLEAN',
69
- :'collect_cvv2' => :'BOOLEAN',
70
- :'configured_gateway_details' => :'String',
71
- :'failed_attempts' => :'Integer',
72
- :'hide_connect_single_gateway' => :'BOOLEAN',
73
- :'send_customer_billing_update_on_decline' => :'BOOLEAN',
74
- :'supported_cards' => :'Array<PaymentsConfigurationCreditCardType>',
75
- :'test_methods' => :'Array<PaymentsConfigurationTestMethod>'
76
- }
77
- end
78
-
79
- # Initializes the object
80
- # @param [Hash] attributes Model attributes in the form of hash
81
- def initialize(attributes = {})
82
- return unless attributes.is_a?(Hash)
83
-
84
- # convert string to symbol for hash key
85
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
86
-
87
- if attributes.has_key?(:'accept_credit_card')
88
- self.accept_credit_card = attributes[:'accept_credit_card']
89
- end
90
-
91
- if attributes.has_key?(:'billed_by')
92
- self.billed_by = attributes[:'billed_by']
93
- end
94
-
95
- if attributes.has_key?(:'charge_during_checkout')
96
- self.charge_during_checkout = attributes[:'charge_during_checkout']
97
- end
98
-
99
- if attributes.has_key?(:'collect_cvv2')
100
- self.collect_cvv2 = attributes[:'collect_cvv2']
101
- end
102
-
103
- if attributes.has_key?(:'configured_gateway_details')
104
- self.configured_gateway_details = attributes[:'configured_gateway_details']
105
- end
106
-
107
- if attributes.has_key?(:'failed_attempts')
108
- self.failed_attempts = attributes[:'failed_attempts']
109
- end
110
-
111
- if attributes.has_key?(:'hide_connect_single_gateway')
112
- self.hide_connect_single_gateway = attributes[:'hide_connect_single_gateway']
113
- end
114
-
115
- if attributes.has_key?(:'send_customer_billing_update_on_decline')
116
- self.send_customer_billing_update_on_decline = attributes[:'send_customer_billing_update_on_decline']
117
- end
118
-
119
- if attributes.has_key?(:'supported_cards')
120
- if (value = attributes[:'supported_cards']).is_a?(Array)
121
- self.supported_cards = value
122
- end
123
- end
124
-
125
- if attributes.has_key?(:'test_methods')
126
- if (value = attributes[:'test_methods']).is_a?(Array)
127
- self.test_methods = value
128
- end
129
- end
130
- end
131
-
132
- # Show invalid properties with the reasons. Usually used together with valid?
133
- # @return Array for valid properties with the reasons
134
- def list_invalid_properties
135
- invalid_properties = Array.new
136
- invalid_properties
137
- end
138
-
139
- # Check to see if the all the properties in the model are valid
140
- # @return true if the model is valid
141
- def valid?
142
- true
143
- end
144
-
145
- # Checks equality by comparing each attribute.
146
- # @param [Object] Object to be compared
147
- def ==(o)
148
- return true if self.equal?(o)
149
- self.class == o.class &&
150
- accept_credit_card == o.accept_credit_card &&
151
- billed_by == o.billed_by &&
152
- charge_during_checkout == o.charge_during_checkout &&
153
- collect_cvv2 == o.collect_cvv2 &&
154
- configured_gateway_details == o.configured_gateway_details &&
155
- failed_attempts == o.failed_attempts &&
156
- hide_connect_single_gateway == o.hide_connect_single_gateway &&
157
- send_customer_billing_update_on_decline == o.send_customer_billing_update_on_decline &&
158
- supported_cards == o.supported_cards &&
159
- test_methods == o.test_methods
160
- end
161
-
162
- # @see the `==` method
163
- # @param [Object] Object to be compared
164
- def eql?(o)
165
- self == o
166
- end
167
-
168
- # Calculates hash code according to all attributes.
169
- # @return [Fixnum] Hash code
170
- def hash
171
- [accept_credit_card, billed_by, charge_during_checkout, collect_cvv2, configured_gateway_details, failed_attempts, hide_connect_single_gateway, send_customer_billing_update_on_decline, supported_cards, test_methods].hash
172
- end
173
-
174
- # Builds the object from hash
175
- # @param [Hash] attributes Model attributes in the form of hash
176
- # @return [Object] Returns the model itself
177
- def build_from_hash(attributes)
178
- return nil unless attributes.is_a?(Hash)
179
- self.class.swagger_types.each_pair do |key, type|
180
- if type =~ /\AArray<(.*)>/i
181
- # check to ensure the input is an array given that the attribute
182
- # is documented as an array but the input is not
183
- if attributes[self.class.attribute_map[key]].is_a?(Array)
184
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
185
- end
186
- elsif !attributes[self.class.attribute_map[key]].nil?
187
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
188
- end # or else data not found in attributes(hash), not an issue as the data can be optional
189
- end
190
-
191
- self
192
- end
193
-
194
- # Deserializes the data based on type
195
- # @param string type Data type
196
- # @param string value Value to be deserialized
197
- # @return [Object] Deserialized data
198
- def _deserialize(type, value)
199
- case type.to_sym
200
- when :DateTime
201
- DateTime.parse(value)
202
- when :Date
203
- Date.parse(value)
204
- when :String
205
- value.to_s
206
- when :Integer
207
- value.to_i
208
- when :Float
209
- value.to_f
210
- when :BOOLEAN
211
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
212
- true
213
- else
214
- false
215
- end
216
- when :Object
217
- # generic object (usually a Hash), return directly
218
- value
219
- when /\AArray<(?<inner_type>.+)>\z/
220
- inner_type = Regexp.last_match[:inner_type]
221
- value.map { |v| _deserialize(inner_type, v) }
222
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
223
- k_type = Regexp.last_match[:k_type]
224
- v_type = Regexp.last_match[:v_type]
225
- {}.tap do |hash|
226
- value.each do |k, v|
227
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
228
- end
229
- end
230
- else # model
231
- temp_model = UltracartClient.const_get(type).new
232
- temp_model.build_from_hash(value)
233
- end
234
- end
235
-
236
- # Returns the string representation of the object
237
- # @return [String] String presentation of the object
238
- def to_s
239
- to_hash.to_s
240
- end
241
-
242
- # to_body is an alias to to_hash (backward compatibility)
243
- # @return [Hash] Returns the object in the form of hash
244
- def to_body
245
- to_hash
246
- end
247
-
248
- # Returns the object in the form of hash
249
- # @return [Hash] Returns the object in the form of hash
250
- def to_hash
251
- hash = {}
252
- self.class.attribute_map.each_pair do |attr, param|
253
- value = self.send(attr)
254
- next if value.nil?
255
- hash[param] = _to_hash(value)
256
- end
257
- hash
258
- end
259
-
260
- # Outputs non-array value in the form of hash
261
- # For object, use to_hash. Otherwise, just return the value
262
- # @param [Object] value Any valid value
263
- # @return [Hash] Returns the value in the form of hash
264
- def _to_hash(value)
265
- if value.is_a?(Array)
266
- value.compact.map { |v| _to_hash(v) }
267
- elsif value.is_a?(Hash)
268
- {}.tap do |hash|
269
- value.each { |k, v| hash[k] = _to_hash(v) }
270
- end
271
- elsif value.respond_to? :to_hash
272
- value.to_hash
273
- else
274
- value
275
- end
276
- end
277
-
278
- end
279
- end