Class: Io::Flow::V0::Models::SessionForm

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ SessionForm

Returns a new instance of SessionForm.



20153
20154
20155
20156
20157
20158
20159
20160
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20153

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  @ip = (x = opts.delete(:ip); x.nil? ? nil : HttpClient::Preconditions.assert_class('ip', x, String))
  @experience = (x = opts.delete(:experience); x.nil? ? nil : HttpClient::Preconditions.assert_class('experience', x, 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.



20151
20152
20153
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20151

def country
  @country
end

#currencyObject (readonly)

Returns the value of attribute currency.



20151
20152
20153
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20151

def currency
  @currency
end

#experienceObject (readonly)

Returns the value of attribute experience.



20151
20152
20153
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20151

def experience
  @experience
end

#ipObject (readonly)

Returns the value of attribute ip.



20151
20152
20153
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20151

def ip
  @ip
end

#languageObject (readonly)

Returns the value of attribute language.



20151
20152
20153
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20151

def language
  @language
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



20166
20167
20168
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20166

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

#to_hashObject



20170
20171
20172
20173
20174
20175
20176
20177
20178
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20170

def to_hash
  {
    :ip => ip,
    :experience => experience,
    :country => country,
    :currency => currency,
    :language => language
  }
end

#to_jsonObject



20162
20163
20164
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20162

def to_json
  JSON.dump(to_hash)
end