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
Returns a new instance of ConsumerInvoiceLineDiscount.
36655 36656 36657 36658 36659 36660 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36655 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.
36653 36654 36655 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36653 def price @price end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
36666 36667 36668 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36666 def copy(incoming={}) ConsumerInvoiceLineDiscount.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
36670 36671 36672 36673 36674 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36670 def subtype_to_hash { :price => price.to_hash } end |
#to_json ⇒ Object
36662 36663 36664 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36662 def to_json JSON.dump(to_hash) end |