Class: Io::Flow::V0::Models::MerchantGiftCardBalance
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::MerchantGiftCardBalance
- 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 = {}) ⇒ MerchantGiftCardBalance
constructor
A new instance of MerchantGiftCardBalance.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ MerchantGiftCardBalance
Returns a new instance of MerchantGiftCardBalance.
36607 36608 36609 36610 36611 36612 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36607 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:amount, :currency], 'MerchantGiftCardBalance') @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) end |
Instance Attribute Details
#amount ⇒ Object (readonly)
Returns the value of attribute amount.
36605 36606 36607 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36605 def amount @amount end |
#currency ⇒ Object (readonly)
Returns the value of attribute currency.
36605 36606 36607 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36605 def currency @currency end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
36618 36619 36620 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36618 def copy(incoming={}) MerchantGiftCardBalance.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
36622 36623 36624 36625 36626 36627 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36622 def to_hash { :amount => amount.to_f.to_s, :currency => currency } end |
#to_json ⇒ Object
36614 36615 36616 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36614 def to_json JSON.dump(to_hash) end |