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.



50168
50169
50170
50171
50172
50173
50174
50175
50176
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50168

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:country], '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.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::RegionType) ? x : ::Io::Flow::V0::Models::RegionType.apply(x)))
  @region_value = (x = opts.delete(:region_value); x.nil? ? nil : HttpClient::Preconditions.assert_class('region_value', x, String))
  @category_code = (x = opts.delete(:category_code); x.nil? ? nil : HttpClient::Preconditions.assert_class('category_code', x, String))
end

Instance Attribute Details

#category_codeObject (readonly)

Returns the value of attribute category_code.



50166
50167
50168
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50166

def category_code
  @category_code
end

#countryObject (readonly)

Returns the value of attribute country.



50166
50167
50168
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50166

def country
  @country
end

Returns the value of attribute legal_name.



50166
50167
50168
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50166

def legal_name
  @legal_name
end

#regionObject (readonly)

Returns the value of attribute region.



50166
50167
50168
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50166

def region
  @region
end

#region_valueObject (readonly)

Returns the value of attribute region_value.



50166
50167
50168
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50166

def region_value
  @region_value
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



50182
50183
50184
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50182

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

#to_hashObject



50186
50187
50188
50189
50190
50191
50192
50193
50194
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50186

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

#to_jsonObject



50178
50179
50180
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50178

def to_json
  JSON.dump(to_hash)
end