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.



10737
10738
10739
10740
10741
10742
10743
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10737

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.



10735
10736
10737
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10735

def id
  @id
end

#keyObject (readonly)

Returns the value of attribute key.



10735
10736
10737
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10735

def key
  @key
end

#nameObject (readonly)

Returns the value of attribute name.



10735
10736
10737
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10735

def name
  @name
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



10749
10750
10751
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10749

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

#to_hashObject



10753
10754
10755
10756
10757
10758
10759
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10753

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

#to_jsonObject



10745
10746
10747
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10745

def to_json
  JSON.dump(to_hash)
end