Class: Io::Flow::V0::Models::ConsumerInvoiceLevy
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::ConsumerInvoiceLevy
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#rate ⇒ Object
readonly
Returns the value of attribute rate.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ ConsumerInvoiceLevy
constructor
A new instance of ConsumerInvoiceLevy.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ ConsumerInvoiceLevy
Returns a new instance of ConsumerInvoiceLevy.
20546 20547 20548 20549 20550 20551 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20546 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:rate, :value], 'ConsumerInvoiceLevy') @rate = HttpClient::Preconditions.assert_class('rate', HttpClient::Helper.to_big_decimal(opts.delete(:rate)), BigDecimal) @value = (x = opts.delete(:value); x.is_a?(::Io::Flow::V0::Models::Price) ? x : ::Io::Flow::V0::Models::Price.new(x)) end |
Instance Attribute Details
#rate ⇒ Object (readonly)
Returns the value of attribute rate.
20544 20545 20546 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20544 def rate @rate end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
20544 20545 20546 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20544 def value @value end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
20557 20558 20559 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20557 def copy(incoming={}) ConsumerInvoiceLevy.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
20561 20562 20563 20564 20565 20566 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20561 def to_hash { :rate => rate, :value => value.to_hash } end |
#to_json ⇒ Object
20553 20554 20555 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20553 def to_json JSON.dump(to_hash) end |