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.



16401
16402
16403
16404
16405
16406
16407
16408
16409
16410
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16401

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)
  @country = (x = opts.delete(:country); x.nil? ? nil : HttpClient::Preconditions.assert_class('country', x, String))
  @currency = (x = opts.delete(:currency); x.nil? ? nil : HttpClient::Preconditions.assert_class('currency', x, String))
  @language = (x = opts.delete(:language); x.nil? ? nil : HttpClient::Preconditions.assert_class('language', x, String))
end

Instance Attribute Details

#countryObject (readonly)

Returns the value of attribute country.



16399
16400
16401
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16399

def country
  @country
end

#currencyObject (readonly)

Returns the value of attribute currency.



16399
16400
16401
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16399

def currency
  @currency
end

#idObject (readonly)

Returns the value of attribute id.



16399
16400
16401
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16399

def id
  @id
end

#keyObject (readonly)

Returns the value of attribute key.



16399
16400
16401
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16399

def key
  @key
end

#languageObject (readonly)

Returns the value of attribute language.



16399
16400
16401
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16399

def language
  @language
end

#nameObject (readonly)

Returns the value of attribute name.



16399
16400
16401
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16399

def name
  @name
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



16416
16417
16418
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16416

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

#to_hashObject



16420
16421
16422
16423
16424
16425
16426
16427
16428
16429
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16420

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

#to_jsonObject



16412
16413
16414
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16412

def to_json
  JSON.dump(to_hash)
end