Class: Io::Flow::V0::Models::ExperienceSummary

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Overview

Some important fields related to experiences used in various APIs

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ ExperienceSummary

Returns a new instance of ExperienceSummary.



13234
13235
13236
13237
13238
13239
13240
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13234

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

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



13232
13233
13234
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13232

def id
  @id
end

#keyObject (readonly)

Returns the value of attribute key.



13232
13233
13234
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13232

def key
  @key
end

#nameObject (readonly)

Returns the value of attribute name.



13232
13233
13234
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13232

def name
  @name
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



13246
13247
13248
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13246

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

#to_hashObject



13250
13251
13252
13253
13254
13255
13256
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13250

def to_hash
  {
    :id => id,
    :key => key,
    :name => name
  }
end

#to_jsonObject



13242
13243
13244
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13242

def to_json
  JSON.dump(to_hash)
end