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.



45150
45151
45152
45153
45154
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 45150

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.



45148
45149
45150
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 45148

def quantity
  @quantity
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



45160
45161
45162
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 45160

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

#to_hashObject



45164
45165
45166
45167
45168
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 45164

def to_hash
  {
    :quantity => quantity
  }
end

#to_jsonObject



45156
45157
45158
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 45156

def to_json
  JSON.dump(to_hash)
end