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.
25464 25465 25466 25467 25468 25469 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25464 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.
25462 25463 25464 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25462 def rate @rate end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
25462 25463 25464 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25462 def value @value end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
25475 25476 25477 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25475 def copy(incoming={}) ConsumerInvoiceLevy.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
25479 25480 25481 25482 25483 25484 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25479 def to_hash { :rate => rate.to_f.to_s, :value => value.to_hash } end |
#to_json ⇒ Object
25471 25472 25473 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25471 def to_json JSON.dump(to_hash) end |