Class: Io::Flow::V0::Models::SessionExperienceReference

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

Returns a new instance of SessionExperienceReference.



19977
19978
19979
19980
19981
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19977

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

Instance Attribute Details

#key ⇒ Object (readonly)

Returns the value of attribute key.



19975
19976
19977
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19975

def key
  @key
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



19987
19988
19989
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19987

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

#to_hash ⇒ Object



19991
19992
19993
19994
19995
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19991

def to_hash
  {
    :key => key
  }
end

#to_json ⇒ Object



19983
19984
19985
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19983

def to_json
  JSON.dump(to_hash)
end