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.



32805
32806
32807
32808
32809
32810
32811
32812
32813
32814
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32805

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.



32803
32804
32805
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32803

def country
  @country
end

#currencyObject (readonly)

Returns the value of attribute currency.



32803
32804
32805
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32803

def currency
  @currency
end

#idObject (readonly)

Returns the value of attribute id.



32803
32804
32805
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32803

def id
  @id
end

#keyObject (readonly)

Returns the value of attribute key.



32803
32804
32805
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32803

def key
  @key
end

#languageObject (readonly)

Returns the value of attribute language.



32803
32804
32805
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32803

def language
  @language
end

#nameObject (readonly)

Returns the value of attribute name.



32803
32804
32805
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32803

def name
  @name
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



32820
32821
32822
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32820

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

#to_hashObject



32824
32825
32826
32827
32828
32829
32830
32831
32832
32833
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32824

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

#to_jsonObject



32816
32817
32818
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32816

def to_json
  JSON.dump(to_hash)
end