Class: Io::Flow::V0::Models::ItemReference

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

Returns a new instance of ItemReference.



32688
32689
32690
32691
32692
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32688

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

Instance Attribute Details

#numberObject (readonly)

Returns the value of attribute number.



32686
32687
32688
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32686

def number
  @number
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



32698
32699
32700
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32698

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

#to_hashObject



32702
32703
32704
32705
32706
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32702

def to_hash
  {
    :number => number
  }
end

#to_jsonObject



32694
32695
32696
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32694

def to_json
  JSON.dump(to_hash)
end