Class: Io::Flow::V0::Models::SessionReference

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

Returns a new instance of SessionReference.



50802
50803
50804
50805
50806
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50802

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

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



50800
50801
50802
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50800

def id
  @id
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



50812
50813
50814
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50812

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

#to_hashObject



50816
50817
50818
50819
50820
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50816

def to_hash
  {
    :id => id
  }
end

#to_jsonObject



50808
50809
50810
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50808

def to_json
  JSON.dump(to_hash)
end