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.



31298
31299
31300
31301
31302
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31298

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.



31296
31297
31298
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31296

def number
  @number
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



31308
31309
31310
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31308

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

#to_hashObject



31312
31313
31314
31315
31316
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31312

def to_hash
  {
    :number => number
  }
end

#to_jsonObject



31304
31305
31306
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31304

def to_json
  JSON.dump(to_hash)
end