Class: Io::Flow::V0::Models::OrderLineUpdateForm

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 = {}) ⇒ OrderLineUpdateForm

Returns a new instance of OrderLineUpdateForm.



21822
21823
21824
21825
21826
21827
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21822

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:item_number, :quantity], 'OrderLineUpdateForm')
  @item_number = HttpClient::Preconditions.assert_class('item_number', opts.delete(:item_number), String)
  @quantity = HttpClient::Preconditions.assert_class('quantity', opts.delete(:quantity), Integer)
end

Instance Attribute Details

#item_numberObject (readonly)

Returns the value of attribute item_number.



21820
21821
21822
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21820

def item_number
  @item_number
end

#quantityObject (readonly)

Returns the value of attribute quantity.



21820
21821
21822
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21820

def quantity
  @quantity
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



21833
21834
21835
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21833

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

#to_hashObject



21837
21838
21839
21840
21841
21842
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21837

def to_hash
  {
    :item_number => item_number,
    :quantity => quantity
  }
end

#to_jsonObject



21829
21830
21831
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21829

def to_json
  JSON.dump(to_hash)
end