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.



43138
43139
43140
43141
43142
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43138

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.



43136
43137
43138
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43136

def quantity
  @quantity
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



43148
43149
43150
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43148

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

#to_hashObject



43152
43153
43154
43155
43156
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43152

def to_hash
  {
    :quantity => quantity
  }
end

#to_jsonObject



43144
43145
43146
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43144

def to_json
  JSON.dump(to_hash)
end