Class: Io::Flow::V0::Models::AddressConfiguration
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::AddressConfiguration
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#country ⇒ Object
readonly
Returns the value of attribute country.
-
#field_validation ⇒ Object
readonly
Returns the value of attribute field_validation.
-
#formats ⇒ Object
readonly
Returns the value of attribute formats.
-
#provinces ⇒ Object
readonly
Returns the value of attribute provinces.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ AddressConfiguration
constructor
A new instance of AddressConfiguration.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ AddressConfiguration
Returns a new instance of AddressConfiguration.
21778 21779 21780 21781 21782 21783 21784 21785 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21778 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:country, :field_validation], 'AddressConfiguration') @country = HttpClient::Preconditions.assert_class('country', opts.delete(:country), String) @field_validation = (x = opts.delete(:field_validation); x.is_a?(::Io::Flow::V0::Models::AddressFieldValidation) ? x : ::Io::Flow::V0::Models::AddressFieldValidation.new(x)) @provinces = HttpClient::Preconditions.assert_class('provinces', (x = opts.delete(:provinces); x.nil? ? [] : x), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::AddressConfigurationProvince) ? x : ::Io::Flow::V0::Models::AddressConfigurationProvince.new(x)) } @formats = HttpClient::Preconditions.assert_class('formats', (x = opts.delete(:formats); x.nil? ? [] : x), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::AddressConfigurationFormat) ? x : ::Io::Flow::V0::Models::AddressConfigurationFormat.new(x)) } end |
Instance Attribute Details
#country ⇒ Object (readonly)
Returns the value of attribute country.
21776 21777 21778 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21776 def country @country end |
#field_validation ⇒ Object (readonly)
Returns the value of attribute field_validation.
21776 21777 21778 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21776 def field_validation @field_validation end |
#formats ⇒ Object (readonly)
Returns the value of attribute formats.
21776 21777 21778 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21776 def formats @formats end |
#provinces ⇒ Object (readonly)
Returns the value of attribute provinces.
21776 21777 21778 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21776 def provinces @provinces end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
21791 21792 21793 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21791 def copy(incoming={}) AddressConfiguration.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
21795 21796 21797 21798 21799 21800 21801 21802 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21795 def to_hash { :country => country, :field_validation => field_validation.to_hash, :provinces => provinces.map { |o| o.to_hash }, :formats => formats.map { |o| o.to_hash } } end |
#to_json ⇒ Object
21787 21788 21789 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21787 def to_json JSON.dump(to_hash) end |