Class: Io::Flow::V0::Models::PaymentAddress
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::PaymentAddress
- 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 = {}) ⇒ PaymentAddress
constructor
A new instance of PaymentAddress.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ PaymentAddress
Returns a new instance of PaymentAddress.
56293 56294 56295 56296 56297 56298 56299 56300 56301 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 56293 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:streets, :city, :country], 'PaymentAddress') @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) end |
Instance Attribute Details
#city ⇒ Object (readonly)
Returns the value of attribute city.
56291 56292 56293 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 56291 def city @city end |
#country ⇒ Object (readonly)
Returns the value of attribute country.
56291 56292 56293 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 56291 def country @country end |
#postal ⇒ Object (readonly)
Returns the value of attribute postal.
56291 56292 56293 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 56291 def postal @postal end |
#province ⇒ Object (readonly)
Returns the value of attribute province.
56291 56292 56293 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 56291 def province @province end |
#streets ⇒ Object (readonly)
Returns the value of attribute streets.
56291 56292 56293 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 56291 def streets @streets end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
56307 56308 56309 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 56307 def copy(incoming={}) PaymentAddress.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
56311 56312 56313 56314 56315 56316 56317 56318 56319 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 56311 def to_hash { :streets => streets, :city => city, :province => province, :postal => postal, :country => country } end |
#to_json ⇒ Object
56303 56304 56305 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 56303 def to_json JSON.dump(to_hash) end |