Class: Io::Flow::V0::Models::OrderQuoteSummaryItems
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::OrderQuoteSummaryItems
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#lines ⇒ Object
readonly
Returns the value of attribute lines.
-
#total ⇒ Object
readonly
Returns the value of attribute total.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ OrderQuoteSummaryItems
constructor
A new instance of OrderQuoteSummaryItems.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ OrderQuoteSummaryItems
Returns a new instance of OrderQuoteSummaryItems.
53474 53475 53476 53477 53478 53479 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53474 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:lines, :total], 'OrderQuoteSummaryItems') @lines = HttpClient::Preconditions.assert_class('lines', opts.delete(:lines), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::OrderQuoteLine) ? x : ::Io::Flow::V0::Models::OrderQuoteLine.new(x)) } @total = (x = opts.delete(:total); x.is_a?(::Io::Flow::V0::Models::OrderQuotePrice) ? x : ::Io::Flow::V0::Models::OrderQuotePrice.from_json(x)) end |
Instance Attribute Details
#lines ⇒ Object (readonly)
Returns the value of attribute lines.
53472 53473 53474 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53472 def lines @lines end |
#total ⇒ Object (readonly)
Returns the value of attribute total.
53472 53473 53474 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53472 def total @total end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
53485 53486 53487 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53485 def copy(incoming={}) OrderQuoteSummaryItems.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
53489 53490 53491 53492 53493 53494 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53489 def to_hash { :lines => lines.map { |o| o.to_hash }, :total => total.to_hash } end |
#to_json ⇒ Object
53481 53482 53483 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53481 def to_json JSON.dump(to_hash) end |