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.



37064
37065
37066
37067
37068
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37064

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.



37062
37063
37064
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37062

def id
  @id
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



37074
37075
37076
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37074

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

#to_hashObject



37078
37079
37080
37081
37082
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37078

def to_hash
  {
    :id => id
  }
end

#to_jsonObject



37070
37071
37072
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37070

def to_json
  JSON.dump(to_hash)
end