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.
47501 47502 47503 47504 47505 47506 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47501 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.
47499 47500 47501 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47499 def lines @lines end |
#total ⇒ Object (readonly)
Returns the value of attribute total.
47499 47500 47501 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47499 def total @total end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
47512 47513 47514 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47512 def copy(incoming={}) OrderQuoteSummaryItems.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
47516 47517 47518 47519 47520 47521 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47516 def to_hash { :lines => lines.map { |o| o.to_hash }, :total => total.to_hash } end |
#to_json ⇒ Object
47508 47509 47510 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47508 def to_json JSON.dump(to_hash) end |