Class: Io::Flow::V0::Models::StreetAddress
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::StreetAddress
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#city ⇒ Object
readonly
Returns the value of attribute city.
-
#country ⇒ Object
readonly
Returns the value of attribute country.
-
#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.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ StreetAddress
constructor
A new instance of StreetAddress.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ StreetAddress
Returns a new instance of StreetAddress.
68790 68791 68792 68793 68794 68795 68796 68797 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 68790 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) @streets = (x = opts.delete(:streets); x.nil? ? nil : HttpClient::Preconditions.assert_class('streets', x, Array).map { |v| HttpClient::Preconditions.assert_class('streets', v, String) }) @city = (x = opts.delete(:city); x.nil? ? nil : HttpClient::Preconditions.assert_class('city', x, 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 = (x = opts.delete(:country); x.nil? ? nil : HttpClient::Preconditions.assert_class('country', x, String)) end |
Instance Attribute Details
#city ⇒ Object (readonly)
Returns the value of attribute city.
68788 68789 68790 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 68788 def city @city end |
#country ⇒ Object (readonly)
Returns the value of attribute country.
68788 68789 68790 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 68788 def country @country end |
#postal ⇒ Object (readonly)
Returns the value of attribute postal.
68788 68789 68790 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 68788 def postal @postal end |
#province ⇒ Object (readonly)
Returns the value of attribute province.
68788 68789 68790 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 68788 def province @province end |
#streets ⇒ Object (readonly)
Returns the value of attribute streets.
68788 68789 68790 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 68788 def streets @streets end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
68803 68804 68805 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 68803 def copy(incoming={}) StreetAddress.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
68807 68808 68809 68810 68811 68812 68813 68814 68815 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 68807 def to_hash { :streets => streets.nil? ? nil : streets, :city => city, :province => province, :postal => postal, :country => country } end |
#to_json ⇒ Object
68799 68800 68801 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 68799 def to_json JSON.dump(to_hash) end |