Class: Revolut::Api::Response::Address
- Inherits:
-
Object
- Object
- Revolut::Api::Response::Address
- Defined in:
- lib/revolut/api/response/address.rb
Constant Summary collapse
- MAPPING =
{ "country" => :country, "city" => :city, "postcode" => :postcode, "region" => :region, "streetLine1" => :street_line_one, "streetLine2" => :street_line_two }
Instance Attribute Summary collapse
-
#city ⇒ Object
Returns the value of attribute city.
-
#country ⇒ Object
Returns the value of attribute country.
-
#mapping ⇒ Object
Returns the value of attribute mapping.
-
#postcode ⇒ Object
Returns the value of attribute postcode.
-
#region ⇒ Object
Returns the value of attribute region.
-
#street_line_one ⇒ Object
Returns the value of attribute street_line_one.
-
#street_line_two ⇒ Object
Returns the value of attribute street_line_two.
Instance Method Summary collapse
-
#initialize(hash = {}) ⇒ Address
constructor
A new instance of Address.
- #to_api_hash ⇒ Object
Constructor Details
#initialize(hash = {}) ⇒ Address
Returns a new instance of Address.
17 18 19 20 21 |
# File 'lib/revolut/api/response/address.rb', line 17 def initialize(hash = {}) ::Revolut::Api::Response::Address::MAPPING.each do |revolut_key, accessor| self.send("#{accessor}=", hash.fetch(revolut_key, nil)) end end |
Instance Attribute Details
#city ⇒ Object
Returns the value of attribute city.
6 7 8 |
# File 'lib/revolut/api/response/address.rb', line 6 def city @city end |
#country ⇒ Object
Returns the value of attribute country.
6 7 8 |
# File 'lib/revolut/api/response/address.rb', line 6 def country @country end |
#mapping ⇒ Object
Returns the value of attribute mapping.
5 6 7 |
# File 'lib/revolut/api/response/address.rb', line 5 def mapping @mapping end |
#postcode ⇒ Object
Returns the value of attribute postcode.
6 7 8 |
# File 'lib/revolut/api/response/address.rb', line 6 def postcode @postcode end |
#region ⇒ Object
Returns the value of attribute region.
6 7 8 |
# File 'lib/revolut/api/response/address.rb', line 6 def region @region end |
#street_line_one ⇒ Object
Returns the value of attribute street_line_one.
6 7 8 |
# File 'lib/revolut/api/response/address.rb', line 6 def street_line_one @street_line_one end |
#street_line_two ⇒ Object
Returns the value of attribute street_line_two.
6 7 8 |
# File 'lib/revolut/api/response/address.rb', line 6 def street_line_two @street_line_two end |