Class: Io::Flow::V0::Models::LineItemQuantityForm

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

Returns a new instance of LineItemQuantityForm.



38516
38517
38518
38519
38520
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38516

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

Instance Attribute Details

#quantityObject (readonly)

Returns the value of attribute quantity.



38514
38515
38516
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38514

def quantity
  @quantity
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



38526
38527
38528
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38526

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

#to_hashObject



38530
38531
38532
38533
38534
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38530

def to_hash
  {
    :quantity => quantity
  }
end

#to_jsonObject



38522
38523
38524
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38522

def to_json
  JSON.dump(to_hash)
end