Class: Io::Flow::V0::Models::MerchantInfo

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

Returns a new instance of MerchantInfo.



46541
46542
46543
46544
46545
46546
46547
46548
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46541

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:country, :region, :region_value], 'MerchantInfo')
  @legal_name = (x = opts.delete(:legal_name); x.nil? ? nil : HttpClient::Preconditions.assert_class('legal_name', x, String))
  @country = HttpClient::Preconditions.assert_class('country', opts.delete(:country), String)
  @region = (x = opts.delete(:region); x.is_a?(::Io::Flow::V0::Models::RegionType) ? x : ::Io::Flow::V0::Models::RegionType.apply(x))
  @region_value = HttpClient::Preconditions.assert_class('region_value', opts.delete(:region_value), String)
end

Instance Attribute Details

#countryObject (readonly)

Returns the value of attribute country.



46539
46540
46541
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46539

def country
  @country
end

Returns the value of attribute legal_name.



46539
46540
46541
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46539

def legal_name
  @legal_name
end

#regionObject (readonly)

Returns the value of attribute region.



46539
46540
46541
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46539

def region
  @region
end

#region_valueObject (readonly)

Returns the value of attribute region_value.



46539
46540
46541
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46539

def region_value
  @region_value
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



46554
46555
46556
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46554

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

#to_hashObject



46558
46559
46560
46561
46562
46563
46564
46565
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46558

def to_hash
  {
    :legal_name => legal_name,
    :country => country,
    :region => region.value,
    :region_value => region_value
  }
end

#to_jsonObject



46550
46551
46552
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46550

def to_json
  JSON.dump(to_hash)
end