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.



20003
20004
20005
20006
20007
20008
20009
20010
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20003

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

#country ⇒ Object (readonly)

Returns the value of attribute country.



20001
20002
20003
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20001

def country
  @country
end

#currency ⇒ Object (readonly)

Returns the value of attribute currency.



20001
20002
20003
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20001

def currency
  @currency
end

#experience ⇒ Object (readonly)

Returns the value of attribute experience.



20001
20002
20003
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20001

def experience
  @experience
end

#ip ⇒ Object (readonly)

Returns the value of attribute ip.



20001
20002
20003
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20001

def ip
  @ip
end

#language ⇒ Object (readonly)

Returns the value of attribute language.



20001
20002
20003
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20001

def language
  @language
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



20016
20017
20018
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20016

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

#to_hash ⇒ Object



20020
20021
20022
20023
20024
20025
20026
20027
20028
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20020

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

#to_json ⇒ Object



20012
20013
20014
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20012

def to_json
  JSON.dump(to_hash)
end