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.
52058 52059 52060 52061 52062 52063 52064 52065 52066 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52058 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.
52056 52057 52058 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52056 def city @city end |
#country ⇒ Object (readonly)
Returns the value of attribute country.
52056 52057 52058 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52056 def country @country end |
#postal ⇒ Object (readonly)
Returns the value of attribute postal.
52056 52057 52058 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52056 def postal @postal end |
#province ⇒ Object (readonly)
Returns the value of attribute province.
52056 52057 52058 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52056 def province @province end |
#streets ⇒ Object (readonly)
Returns the value of attribute streets.
52056 52057 52058 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52056 def streets @streets end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
52072 52073 52074 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52072 def copy(incoming={}) PaymentAddress.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
52076 52077 52078 52079 52080 52081 52082 52083 52084 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52076 def to_hash { :streets => streets, :city => city, :province => province, :postal => postal, :country => country } end |
#to_json ⇒ Object
52068 52069 52070 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52068 def to_json JSON.dump(to_hash) end |