Class: Io::Flow::V0::Models::PaymentDuty
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::PaymentDuty
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#amount ⇒ Object
readonly
Returns the value of attribute amount.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ PaymentDuty
constructor
A new instance of PaymentDuty.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ PaymentDuty
Returns a new instance of PaymentDuty.
56777 56778 56779 56780 56781 56782 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 56777 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:amount], 'PaymentDuty') @amount = HttpClient::Preconditions.assert_class('amount', HttpClient::Helper.to_big_decimal(opts.delete(:amount)), BigDecimal) @name = HttpClient::Preconditions.assert_class('name', (x = opts.delete(:name); x.nil? ? "Duty" : x), String) end |
Instance Attribute Details
#amount ⇒ Object (readonly)
Returns the value of attribute amount.
56775 56776 56777 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 56775 def amount @amount end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
56775 56776 56777 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 56775 def name @name end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
56788 56789 56790 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 56788 def copy(incoming={}) PaymentDuty.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
56792 56793 56794 56795 56796 56797 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 56792 def to_hash { :amount => amount.to_f.to_s, :name => name } end |
#to_json ⇒ Object
56784 56785 56786 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 56784 def to_json JSON.dump(to_hash) end |