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.



37590
37591
37592
37593
37594
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37590

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.



37588
37589
37590
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37588

def quantity
  @quantity
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



37600
37601
37602
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37600

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

#to_hashObject



37604
37605
37606
37607
37608
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37604

def to_hash
  {
    :quantity => quantity
  }
end

#to_jsonObject



37596
37597
37598
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37596

def to_json
  JSON.dump(to_hash)
end