Class: Io::Flow::V0::Models::OrderQuotePutForm

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ OrderQuotePutForm

Returns a new instance of OrderQuotePutForm.



47382
47383
47384
47385
47386
47387
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47382

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  @line_items = (x = opts.delete(:line_items); x.nil? ? nil : HttpClient::Preconditions.assert_class('line_items', x, Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::LineItemForm) ? x : ::Io::Flow::V0::Models::LineItemForm.new(x)) })
  @session = (x = opts.delete(:session); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::SessionReference) ? x : ::Io::Flow::V0::Models::SessionReference.new(x)))
  @geo = (x = opts.delete(:geo); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::OrderQuoteGeoPutForm) ? x : ::Io::Flow::V0::Models::OrderQuoteGeoPutForm.new(x)))
end

Instance Attribute Details

#geoObject (readonly)

Returns the value of attribute geo.



47380
47381
47382
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47380

def geo
  @geo
end

#line_itemsObject (readonly)

Returns the value of attribute line_items.



47380
47381
47382
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47380

def line_items
  @line_items
end

#sessionObject (readonly)

Returns the value of attribute session.



47380
47381
47382
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47380

def session
  @session
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



47393
47394
47395
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47393

def copy(incoming={})
  OrderQuotePutForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end

#to_hashObject



47397
47398
47399
47400
47401
47402
47403
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47397

def to_hash
  {
    :line_items => line_items.nil? ? nil : line_items.map { |o| o.to_hash },
    :session => session.nil? ? nil : session.to_hash,
    :geo => geo.nil? ? nil : geo.to_hash
  }
end

#to_jsonObject



47389
47390
47391
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47389

def to_json
  JSON.dump(to_hash)
end