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.



26377
26378
26379
26380
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26377

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.



26375
26376
26377
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26375

def source
  @source
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



26386
26387
26388
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26386

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

#to_hashObject



26390
26391
26392
26393
26394
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26390

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

#to_jsonObject



26382
26383
26384
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26382

def to_json
  JSON.dump(to_hash)
end