Class: Io::Flow::V0::Models::SessionPutForm

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 = {}) ⇒ SessionPutForm

Returns a new instance of SessionPutForm.



20036
20037
20038
20039
20040
20041
20042
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20036

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  @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.



20034
20035
20036
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20034

def country
  @country
end

#currency ⇒ Object (readonly)

Returns the value of attribute currency.



20034
20035
20036
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20034

def currency
  @currency
end

#experience ⇒ Object (readonly)

Returns the value of attribute experience.



20034
20035
20036
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20034

def experience
  @experience
end

#language ⇒ Object (readonly)

Returns the value of attribute language.



20034
20035
20036
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20034

def language
  @language
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



20048
20049
20050
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20048

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

#to_hash ⇒ Object



20052
20053
20054
20055
20056
20057
20058
20059
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20052

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

#to_json ⇒ Object



20044
20045
20046
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20044

def to_json
  JSON.dump(to_hash)
end