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.
39709 39710 39711 39712 39713 39714 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39709 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.
39707 39708 39709 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39707 def amount @amount end |
#currency ⇒ Object (readonly)
Returns the value of attribute currency.
39707 39708 39709 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39707 def currency @currency end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
39720 39721 39722 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39720 def copy(incoming={}) MerchantGiftCardBalance.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
39724 39725 39726 39727 39728 39729 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39724 def to_hash { :amount => amount.to_f.to_s, :currency => currency } end |
#to_json ⇒ Object
39716 39717 39718 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39716 def to_json JSON.dump(to_hash) end |