Class: Io::Flow::V0::Models::LabelOrderSummary

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

Returns a new instance of LabelOrderSummary.



15309
15310
15311
15312
15313
15314
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15309

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

Instance Attribute Details

#id ⇒ Object (readonly)

Returns the value of attribute id.



15307
15308
15309
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15307

def id
  @id
end

#number ⇒ Object (readonly)

Returns the value of attribute number.



15307
15308
15309
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15307

def number
  @number
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



15320
15321
15322
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15320

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

#to_hash ⇒ Object



15324
15325
15326
15327
15328
15329
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15324

def to_hash
  {
    :id => id,
    :number => number
  }
end

#to_json ⇒ Object



15316
15317
15318
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15316

def to_json
  JSON.dump(to_hash)
end