Class: Io::Flow::V0::Models::PaymentCaptureForm
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::PaymentCaptureForm
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#amount ⇒ Object
readonly
Returns the value of attribute amount.
-
#currency ⇒ Object
readonly
Returns the value of attribute currency.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ PaymentCaptureForm
constructor
A new instance of PaymentCaptureForm.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ PaymentCaptureForm
Returns a new instance of PaymentCaptureForm.
52266 52267 52268 52269 52270 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52266 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) @amount = (x = opts.delete(:amount); x.nil? ? nil : HttpClient::Preconditions.assert_class('amount', HttpClient::Helper.to_big_decimal(x), BigDecimal)) @currency = (x = opts.delete(:currency); x.nil? ? nil : HttpClient::Preconditions.assert_class('currency', x, String)) end |
Instance Attribute Details
#amount ⇒ Object (readonly)
Returns the value of attribute amount.
52264 52265 52266 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52264 def amount @amount end |
#currency ⇒ Object (readonly)
Returns the value of attribute currency.
52264 52265 52266 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52264 def currency @currency end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
52276 52277 52278 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52276 def copy(incoming={}) PaymentCaptureForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
52280 52281 52282 52283 52284 52285 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52280 def to_hash { :amount => amount.to_f.to_s, :currency => currency } end |
#to_json ⇒ Object
52272 52273 52274 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52272 def to_json JSON.dump(to_hash) end |