Class: Io::Flow::V0::Models::CountryPickerForm

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

Returns a new instance of CountryPickerForm.



28210
28211
28212
28213
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28210

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  @source = (x = (x = opts.delete(:source); x.nil? ? "experience" : x); x.is_a?(::Io::Flow::V0::Models::CountryPickerSource) ? x : ::Io::Flow::V0::Models::CountryPickerSource.apply(x))
end

Instance Attribute Details

#sourceObject (readonly)

Returns the value of attribute source.



28208
28209
28210
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28208

def source
  @source
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



28219
28220
28221
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28219

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

#to_hashObject



28223
28224
28225
28226
28227
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28223

def to_hash
  {
    :source => source.value
  }
end

#to_jsonObject



28215
28216
28217
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28215

def to_json
  JSON.dump(to_hash)
end