Class: Io::Flow::V0::Models::ConsumerInvoiceLineDiscount
- Inherits:
-
ConsumerInvoiceLine
- Object
- ConsumerInvoiceLine
- Io::Flow::V0::Models::ConsumerInvoiceLineDiscount
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#price ⇒ Object
readonly
Returns the value of attribute price.
Attributes inherited from ConsumerInvoiceLine
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ ConsumerInvoiceLineDiscount
constructor
A new instance of ConsumerInvoiceLineDiscount.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from ConsumerInvoiceLine
Constructor Details
#initialize(incoming = {}) ⇒ ConsumerInvoiceLineDiscount
33513 33514 33515 33516 33517 33518 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33513 def initialize(incoming={}) super(:discriminator => ConsumerInvoiceLine::Types::CONSUMER_INVOICE_LINE_DISCOUNT) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:price], 'ConsumerInvoiceLineDiscount') @price = (x = opts.delete(:price); x.is_a?(::Io::Flow::V0::Models::Price) ? x : ::Io::Flow::V0::Models::Price.new(x)) end |
Instance Attribute Details
#price ⇒ Object (readonly)
Returns the value of attribute price.
33511 33512 33513 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33511 def price @price end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
33524 33525 33526 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33524 def copy(incoming={}) ConsumerInvoiceLineDiscount.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
33528 33529 33530 33531 33532 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33528 def subtype_to_hash { :price => price.to_hash } end |
#to_json ⇒ Object
33520 33521 33522 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33520 def to_json JSON.dump(to_hash) end |