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.



49482
49483
49484
49485
49486
49487
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49482

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.



49480
49481
49482
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49480

def geo
  @geo
end

#line_itemsObject (readonly)

Returns the value of attribute line_items.



49480
49481
49482
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49480

def line_items
  @line_items
end

#sessionObject (readonly)

Returns the value of attribute session.



49480
49481
49482
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49480

def session
  @session
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



49493
49494
49495
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49493

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

#to_hashObject



49497
49498
49499
49500
49501
49502
49503
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49497

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



49489
49490
49491
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49489

def to_json
  JSON.dump(to_hash)
end