Class: Io::Flow::V0::Models::CreditPaymentForm
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::CreditPaymentForm
- 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.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#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 = {}) ⇒ CreditPaymentForm
constructor
A new instance of CreditPaymentForm.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ CreditPaymentForm
Returns a new instance of CreditPaymentForm.
15163 15164 15165 15166 15167 15168 15169 15170 15171 15172 15173 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15163 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:order_number, :description, :amount, :max, :currency], 'CreditPaymentForm') @order_number = HttpClient::Preconditions.assert_class('order_number', opts.delete(:order_number), String) @key = (x = opts.delete(:key); x.nil? ? nil : HttpClient::Preconditions.assert_class('key', x, 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) @max = HttpClient::Preconditions.assert_class('max', HttpClient::Helper.to_big_decimal(opts.delete(:max)), BigDecimal) @currency = HttpClient::Preconditions.assert_class('currency', opts.delete(:currency), String) @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.
15161 15162 15163 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15161 def amount @amount end |
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
15161 15162 15163 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15161 def attributes @attributes end |
#currency ⇒ Object (readonly)
Returns the value of attribute currency.
15161 15162 15163 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15161 def currency @currency end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
15161 15162 15163 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15161 def description @description end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
15161 15162 15163 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15161 def key @key end |
#max ⇒ Object (readonly)
Returns the value of attribute max.
15161 15162 15163 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15161 def max @max end |
#order_number ⇒ Object (readonly)
Returns the value of attribute order_number.
15161 15162 15163 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15161 def order_number @order_number end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
15179 15180 15181 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15179 def copy(incoming={}) CreditPaymentForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
15183 15184 15185 15186 15187 15188 15189 15190 15191 15192 15193 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15183 def to_hash { :order_number => order_number, :key => key, :description => description, :amount => amount, :max => max, :currency => currency, :attributes => attributes.nil? ? nil : attributes } end |
#to_json ⇒ Object
15175 15176 15177 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15175 def to_json JSON.dump(to_hash) end |