Class: Io::Flow::V0::Models::MerchantOfRecordEntity
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::MerchantOfRecordEntity
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
The merchant of record entity provides the legal name and address of the specific Flow entity serving as merchant of record.
Instance Attribute Summary collapse
-
#city ⇒ Object
readonly
Returns the value of attribute city.
-
#country ⇒ Object
readonly
Returns the value of attribute country.
-
#email ⇒ Object
readonly
Returns the value of attribute email.
-
#identifiers ⇒ Object
readonly
Returns the value of attribute identifiers.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#organization ⇒ Object
readonly
Returns the value of attribute organization.
-
#phone ⇒ Object
readonly
Returns the value of attribute phone.
-
#postal ⇒ Object
readonly
Returns the value of attribute postal.
-
#province ⇒ Object
readonly
Returns the value of attribute province.
-
#streets ⇒ Object
readonly
Returns the value of attribute streets.
-
#vat ⇒ Object
readonly
Returns the value of attribute vat.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ MerchantOfRecordEntity
constructor
A new instance of MerchantOfRecordEntity.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ MerchantOfRecordEntity
Returns a new instance of MerchantOfRecordEntity.
50258 50259 50260 50261 50262 50263 50264 50265 50266 50267 50268 50269 50270 50271 50272 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50258 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:organization, :name, :streets, :city, :country], 'MerchantOfRecordEntity') @organization = (x = opts.delete(:organization); x.is_a?(::Io::Flow::V0::Models::OrganizationReference) ? x : ::Io::Flow::V0::Models::OrganizationReference.new(x)) @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String) @vat = (x = opts.delete(:vat); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::MerchantOfRecordEntityRegistration) ? x : ::Io::Flow::V0::Models::MerchantOfRecordEntityRegistration.new(x))) @identifiers = (x = opts.delete(:identifiers); x.nil? ? nil : HttpClient::Preconditions.assert_class('identifiers', x, Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::EntityIdentifier) ? x : ::Io::Flow::V0::Models::EntityIdentifier.new(x)) }) @streets = HttpClient::Preconditions.assert_class('streets', opts.delete(:streets), Array).map { |v| HttpClient::Preconditions.assert_class('streets', v, String) } @city = HttpClient::Preconditions.assert_class('city', opts.delete(:city), String) @province = (x = opts.delete(:province); x.nil? ? nil : HttpClient::Preconditions.assert_class('province', x, String)) @postal = (x = opts.delete(:postal); x.nil? ? nil : HttpClient::Preconditions.assert_class('postal', x, String)) @country = HttpClient::Preconditions.assert_class('country', opts.delete(:country), String) @phone = (x = opts.delete(:phone); x.nil? ? nil : HttpClient::Preconditions.assert_class('phone', x, String)) @email = (x = opts.delete(:email); x.nil? ? nil : HttpClient::Preconditions.assert_class('email', x, String)) end |
Instance Attribute Details
#city ⇒ Object (readonly)
Returns the value of attribute city.
50256 50257 50258 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50256 def city @city end |
#country ⇒ Object (readonly)
Returns the value of attribute country.
50256 50257 50258 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50256 def country @country end |
#email ⇒ Object (readonly)
Returns the value of attribute email.
50256 50257 50258 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50256 def email @email end |
#identifiers ⇒ Object (readonly)
Returns the value of attribute identifiers.
50256 50257 50258 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50256 def identifiers @identifiers end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
50256 50257 50258 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50256 def name @name end |
#organization ⇒ Object (readonly)
Returns the value of attribute organization.
50256 50257 50258 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50256 def organization @organization end |
#phone ⇒ Object (readonly)
Returns the value of attribute phone.
50256 50257 50258 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50256 def phone @phone end |
#postal ⇒ Object (readonly)
Returns the value of attribute postal.
50256 50257 50258 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50256 def postal @postal end |
#province ⇒ Object (readonly)
Returns the value of attribute province.
50256 50257 50258 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50256 def province @province end |
#streets ⇒ Object (readonly)
Returns the value of attribute streets.
50256 50257 50258 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50256 def streets @streets end |
#vat ⇒ Object (readonly)
Returns the value of attribute vat.
50256 50257 50258 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50256 def vat @vat end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
50278 50279 50280 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50278 def copy(incoming={}) MerchantOfRecordEntity.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
50282 50283 50284 50285 50286 50287 50288 50289 50290 50291 50292 50293 50294 50295 50296 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50282 def to_hash { :organization => organization.to_hash, :name => name, :vat => vat.nil? ? nil : vat.to_hash, :identifiers => identifiers.nil? ? nil : identifiers.map { |o| o.to_hash }, :streets => streets, :city => city, :province => province, :postal => postal, :country => country, :phone => phone, :email => email } end |
#to_json ⇒ Object
50274 50275 50276 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50274 def to_json JSON.dump(to_hash) end |