Class: Io::Flow::V0::Models::CreditPaymentPutForm
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::CreditPaymentPutForm
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#amount ⇒ Object
readonly
Returns the value of attribute amount.
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#currency ⇒ Object
readonly
Returns the value of attribute currency.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#max ⇒ Object
readonly
Returns the value of attribute max.
-
#order_number ⇒ Object
readonly
Returns the value of attribute order_number.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ CreditPaymentPutForm
constructor
A new instance of CreditPaymentPutForm.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ CreditPaymentPutForm
Returns a new instance of CreditPaymentPutForm.
15201 15202 15203 15204 15205 15206 15207 15208 15209 15210 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15201 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:order_number, :description, :amount, :currency, :max], 'CreditPaymentPutForm') @order_number = HttpClient::Preconditions.assert_class('order_number', opts.delete(:order_number), String) @description = HttpClient::Preconditions.assert_class('description', opts.delete(:description), String) @amount = HttpClient::Preconditions.assert_class('amount', HttpClient::Helper.to_big_decimal(opts.delete(:amount)), BigDecimal) @currency = HttpClient::Preconditions.assert_class('currency', opts.delete(:currency), String) @max = HttpClient::Preconditions.assert_class('max', HttpClient::Helper.to_big_decimal(opts.delete(:max)), BigDecimal) @attributes = (x = opts.delete(:attributes); x.nil? ? nil : HttpClient::Preconditions.assert_class('attributes', x, Hash).inject({}) { |h, d| h[d[0]] = HttpClient::Preconditions.assert_class('attributes', d[1], String); h }) end |
Instance Attribute Details
#amount ⇒ Object (readonly)
Returns the value of attribute amount.
15199 15200 15201 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15199 def amount @amount end |
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
15199 15200 15201 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15199 def attributes @attributes end |
#currency ⇒ Object (readonly)
Returns the value of attribute currency.
15199 15200 15201 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15199 def currency @currency end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
15199 15200 15201 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15199 def description @description end |
#max ⇒ Object (readonly)
Returns the value of attribute max.
15199 15200 15201 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15199 def max @max end |
#order_number ⇒ Object (readonly)
Returns the value of attribute order_number.
15199 15200 15201 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15199 def order_number @order_number end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
15216 15217 15218 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15216 def copy(incoming={}) CreditPaymentPutForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
15220 15221 15222 15223 15224 15225 15226 15227 15228 15229 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15220 def to_hash { :order_number => order_number, :description => description, :amount => amount, :currency => currency, :max => max, :attributes => attributes.nil? ? nil : attributes } end |
#to_json ⇒ Object
15212 15213 15214 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15212 def to_json JSON.dump(to_hash) end |