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.



12305
12306
12307
12308
12309
12310
12311
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12305

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

#id ⇒ Object (readonly)

Returns the value of attribute id.



12303
12304
12305
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12303

def id
  @id
end

#key ⇒ Object (readonly)

Returns the value of attribute key.



12303
12304
12305
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12303

def key
  @key
end

#name ⇒ Object (readonly)

Returns the value of attribute name.



12303
12304
12305
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12303

def name
  @name
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



12317
12318
12319
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12317

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

#to_hash ⇒ Object



12321
12322
12323
12324
12325
12326
12327
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12321

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

#to_json ⇒ Object



12313
12314
12315
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12313

def to_json
  JSON.dump(to_hash)
end