Class: Io::Flow::V0::Models::Region
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::Region
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
A region represents a geographic area of the world. Regions can be countries, continents or other political areas (like the Eurozone). See api.flow.io/reference/regions
Instance Attribute Summary collapse
-
#countries ⇒ Object
readonly
Returns the value of attribute countries.
-
#currencies ⇒ Object
readonly
Returns the value of attribute currencies.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#languages ⇒ Object
readonly
Returns the value of attribute languages.
-
#measurement_systems ⇒ Object
readonly
Returns the value of attribute measurement_systems.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#timezones ⇒ Object
readonly
Returns the value of attribute timezones.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ Region
constructor
A new instance of Region.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ Region
Returns a new instance of Region.
46759 46760 46761 46762 46763 46764 46765 46766 46767 46768 46769 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46759 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:id, :name, :countries, :currencies, :languages, :measurement_systems, :timezones], 'Region') @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String) @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String) @countries = HttpClient::Preconditions.assert_class('countries', opts.delete(:countries), Array).map { |v| HttpClient::Preconditions.assert_class('countries', v, String) } @currencies = HttpClient::Preconditions.assert_class('currencies', opts.delete(:currencies), Array).map { |v| HttpClient::Preconditions.assert_class('currencies', v, String) } @languages = HttpClient::Preconditions.assert_class('languages', opts.delete(:languages), Array).map { |v| HttpClient::Preconditions.assert_class('languages', v, String) } @measurement_systems = HttpClient::Preconditions.assert_class('measurement_systems', opts.delete(:measurement_systems), Array).map { |v| HttpClient::Preconditions.assert_class('measurement_systems', v, String) } @timezones = HttpClient::Preconditions.assert_class('timezones', opts.delete(:timezones), Array).map { |v| HttpClient::Preconditions.assert_class('timezones', v, String) } end |
Instance Attribute Details
#countries ⇒ Object (readonly)
Returns the value of attribute countries.
46757 46758 46759 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46757 def countries @countries end |
#currencies ⇒ Object (readonly)
Returns the value of attribute currencies.
46757 46758 46759 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46757 def currencies @currencies end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
46757 46758 46759 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46757 def id @id end |
#languages ⇒ Object (readonly)
Returns the value of attribute languages.
46757 46758 46759 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46757 def languages @languages end |
#measurement_systems ⇒ Object (readonly)
Returns the value of attribute measurement_systems.
46757 46758 46759 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46757 def measurement_systems @measurement_systems end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
46757 46758 46759 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46757 def name @name end |
#timezones ⇒ Object (readonly)
Returns the value of attribute timezones.
46757 46758 46759 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46757 def timezones @timezones end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
46775 46776 46777 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46775 def copy(incoming={}) Region.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
46779 46780 46781 46782 46783 46784 46785 46786 46787 46788 46789 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46779 def to_hash { :id => id, :name => name, :countries => countries, :currencies => currencies, :languages => languages, :measurement_systems => measurement_systems, :timezones => timezones } end |
#to_json ⇒ Object
46771 46772 46773 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46771 def to_json JSON.dump(to_hash) end |