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.



53355
53356
53357
53358
53359
53360
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53355

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.



53353
53354
53355
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53353

def geo
  @geo
end

#line_itemsObject (readonly)

Returns the value of attribute line_items.



53353
53354
53355
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53353

def line_items
  @line_items
end

#sessionObject (readonly)

Returns the value of attribute session.



53353
53354
53355
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53353

def session
  @session
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



53366
53367
53368
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53366

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

#to_hashObject



53370
53371
53372
53373
53374
53375
53376
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53370

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



53362
53363
53364
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53362

def to_json
  JSON.dump(to_hash)
end