Class: Io::Flow::V0::Models::OrderNumberReference

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

Returns a new instance of OrderNumberReference.



33572
33573
33574
33575
33576
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33572

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

Instance Attribute Details

#numberObject (readonly)

Returns the value of attribute number.



33570
33571
33572
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33570

def number
  @number
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



33582
33583
33584
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33582

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

#to_hashObject



33586
33587
33588
33589
33590
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33586

def to_hash
  {
    :number => number
  }
end

#to_jsonObject



33578
33579
33580
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33578

def to_json
  JSON.dump(to_hash)
end