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.
33457 33458 33459 33460 33461 33462 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33457 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.
33455 33456 33457 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33455 def rate @rate end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
33455 33456 33457 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33455 def value @value end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
33468 33469 33470 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33468 def copy(incoming={}) ConsumerInvoiceLevy.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
33472 33473 33474 33475 33476 33477 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33472 def to_hash { :rate => rate.to_f.to_s, :value => value.to_hash } end |
#to_json ⇒ Object
33464 33465 33466 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33464 def to_json JSON.dump(to_hash) end |