Class: Io::Flow::V0::Models::OrderReference

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

Returns a new instance of OrderReference.



13176
13177
13178
13179
13180
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13176

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

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



13174
13175
13176
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13174

def id
  @id
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



13186
13187
13188
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13186

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

#to_hashObject



13190
13191
13192
13193
13194
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13190

def to_hash
  {
    :id => id
  }
end

#to_jsonObject



13182
13183
13184
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13182

def to_json
  JSON.dump(to_hash)
end