Class: Io::Flow::V0::Models::MerchantInfo
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::MerchantInfo
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#category_code ⇒ Object
readonly
Returns the value of attribute category_code.
-
#country ⇒ Object
readonly
Returns the value of attribute country.
-
#legal_name ⇒ Object
readonly
Returns the value of attribute legal_name.
-
#region ⇒ Object
readonly
Returns the value of attribute region.
-
#region_value ⇒ Object
readonly
Returns the value of attribute region_value.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ MerchantInfo
constructor
A new instance of MerchantInfo.
- #to_hash ⇒ Object
- #to_json ⇒ Object
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_code ⇒ Object (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 |
#country ⇒ Object (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 |
#legal_name ⇒ Object (readonly)
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 |
#region ⇒ Object (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_value ⇒ Object (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_hash ⇒ Object
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_json ⇒ Object
50178 50179 50180 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50178 def to_json JSON.dump(to_hash) end |