Class: Io::Flow::V0::Models::OrderQuote
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::OrderQuote
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#form ⇒ Object
readonly
Returns the value of attribute form.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#summary ⇒ Object
readonly
Returns the value of attribute summary.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ OrderQuote
constructor
A new instance of OrderQuote.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ OrderQuote
Returns a new instance of OrderQuote.
52924 52925 52926 52927 52928 52929 52930 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52924 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:id, :form], 'OrderQuote') @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String) @form = (x = opts.delete(:form); x.is_a?(::Io::Flow::V0::Models::OrderQuotePutForm) ? x : ::Io::Flow::V0::Models::OrderQuotePutForm.new(x)) @summary = (x = opts.delete(:summary); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::OrderQuoteSummary) ? x : ::Io::Flow::V0::Models::OrderQuoteSummary.new(x))) end |
Instance Attribute Details
#form ⇒ Object (readonly)
Returns the value of attribute form.
52922 52923 52924 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52922 def form @form end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
52922 52923 52924 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52922 def id @id end |
#summary ⇒ Object (readonly)
Returns the value of attribute summary.
52922 52923 52924 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52922 def summary @summary end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
52936 52937 52938 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52936 def copy(incoming={}) OrderQuote.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
52940 52941 52942 52943 52944 52945 52946 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52940 def to_hash { :id => id, :form => form.to_hash, :summary => summary.nil? ? nil : summary.to_hash } end |
#to_json ⇒ Object
52932 52933 52934 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52932 def to_json JSON.dump(to_hash) end |