Class: Io::Flow::V0::Models::ContextReference

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

Returns a new instance of ContextReference.



33922
33923
33924
33925
33926
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33922

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

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



33920
33921
33922
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33920

def id
  @id
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



33932
33933
33934
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33932

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

#to_hashObject



33936
33937
33938
33939
33940
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33936

def to_hash
  {
    :id => id
  }
end

#to_jsonObject



33928
33929
33930
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33928

def to_json
  JSON.dump(to_hash)
end