Class: Io::Flow::V0::Models::Zone
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::Zone
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#country ⇒ Object
readonly
Returns the value of attribute country.
-
#postals ⇒ Object
readonly
Returns the value of attribute postals.
-
#provinces ⇒ Object
readonly
Returns the value of attribute provinces.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ Zone
constructor
A new instance of Zone.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ Zone
45595 45596 45597 45598 45599 45600 45601 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 45595 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:country], 'Zone') @postals = (x = opts.delete(:postals); x.nil? ? nil : HttpClient::Preconditions.assert_class('postals', x, Array).map { |v| HttpClient::Preconditions.assert_class('postals', v, String) }) @provinces = (x = opts.delete(:provinces); x.nil? ? nil : HttpClient::Preconditions.assert_class('provinces', x, Array).map { |v| HttpClient::Preconditions.assert_class('provinces', v, String) }) @country = HttpClient::Preconditions.assert_class('country', opts.delete(:country), String) end |
Instance Attribute Details
#country ⇒ Object (readonly)
Returns the value of attribute country.
45593 45594 45595 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 45593 def country @country end |
#postals ⇒ Object (readonly)
Returns the value of attribute postals.
45593 45594 45595 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 45593 def postals @postals end |
#provinces ⇒ Object (readonly)
Returns the value of attribute provinces.
45593 45594 45595 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 45593 def provinces @provinces end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
45607 45608 45609 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 45607 def copy(incoming={}) Zone.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
45611 45612 45613 45614 45615 45616 45617 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 45611 def to_hash { :postals => postals.nil? ? nil : postals, :provinces => provinces.nil? ? nil : provinces, :country => country } end |
#to_json ⇒ Object
45603 45604 45605 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 45603 def to_json JSON.dump(to_hash) end |