Class: Postio::Models::Address
- Inherits:
-
Data
- Object
- Data
- Postio::Models::Address
- Defined in:
- lib/postio/models.rb
Overview
Address — full PAF + OS record. Many fields are optional.
Instance Attribute Summary collapse
-
#address_line_1 ⇒ Object
readonly
Returns the value of attribute address_line_1.
-
#address_line_2 ⇒ Object
readonly
Returns the value of attribute address_line_2.
-
#address_line_3 ⇒ Object
readonly
Returns the value of attribute address_line_3.
-
#building_name ⇒ Object
readonly
Returns the value of attribute building_name.
-
#building_number ⇒ Object
readonly
Returns the value of attribute building_number.
-
#country ⇒ Object
readonly
Returns the value of attribute country.
-
#county ⇒ Object
readonly
Returns the value of attribute county.
-
#delivery_point_suffix ⇒ Object
readonly
Returns the value of attribute delivery_point_suffix.
-
#department_name ⇒ Object
readonly
Returns the value of attribute department_name.
-
#dependent_locality ⇒ Object
readonly
Returns the value of attribute dependent_locality.
-
#dependent_thoroughfare ⇒ Object
readonly
Returns the value of attribute dependent_thoroughfare.
-
#district ⇒ Object
readonly
Returns the value of attribute district.
-
#double_dependent_locality ⇒ Object
readonly
Returns the value of attribute double_dependent_locality.
-
#eastings ⇒ Object
readonly
Returns the value of attribute eastings.
-
#latitude ⇒ Object
readonly
Returns the value of attribute latitude.
-
#longitude ⇒ Object
readonly
Returns the value of attribute longitude.
-
#northings ⇒ Object
readonly
Returns the value of attribute northings.
-
#organisation_name ⇒ Object
readonly
Returns the value of attribute organisation_name.
-
#po_box ⇒ Object
readonly
Returns the value of attribute po_box.
-
#post_town ⇒ Object
readonly
Returns the value of attribute post_town.
-
#postcode ⇒ Object
readonly
Returns the value of attribute postcode.
-
#postcode_inward ⇒ Object
readonly
Returns the value of attribute postcode_inward.
-
#postcode_outward ⇒ Object
readonly
Returns the value of attribute postcode_outward.
-
#postcode_type ⇒ Object
readonly
Returns the value of attribute postcode_type.
-
#sub_building_name ⇒ Object
readonly
Returns the value of attribute sub_building_name.
-
#thoroughfare ⇒ Object
readonly
Returns the value of attribute thoroughfare.
-
#udprn ⇒ Object
readonly
Returns the value of attribute udprn.
-
#ward ⇒ Object
readonly
Returns the value of attribute ward.
Class Method Summary collapse
Instance Attribute Details
#address_line_1 ⇒ Object (readonly)
Returns the value of attribute address_line_1
41 42 43 |
# File 'lib/postio/models.rb', line 41 def address_line_1 @address_line_1 end |
#address_line_2 ⇒ Object (readonly)
Returns the value of attribute address_line_2
41 42 43 |
# File 'lib/postio/models.rb', line 41 def address_line_2 @address_line_2 end |
#address_line_3 ⇒ Object (readonly)
Returns the value of attribute address_line_3
41 42 43 |
# File 'lib/postio/models.rb', line 41 def address_line_3 @address_line_3 end |
#building_name ⇒ Object (readonly)
Returns the value of attribute building_name
41 42 43 |
# File 'lib/postio/models.rb', line 41 def building_name @building_name end |
#building_number ⇒ Object (readonly)
Returns the value of attribute building_number
41 42 43 |
# File 'lib/postio/models.rb', line 41 def building_number @building_number end |
#country ⇒ Object (readonly)
Returns the value of attribute country
41 42 43 |
# File 'lib/postio/models.rb', line 41 def country @country end |
#county ⇒ Object (readonly)
Returns the value of attribute county
41 42 43 |
# File 'lib/postio/models.rb', line 41 def county @county end |
#delivery_point_suffix ⇒ Object (readonly)
Returns the value of attribute delivery_point_suffix
41 42 43 |
# File 'lib/postio/models.rb', line 41 def delivery_point_suffix @delivery_point_suffix end |
#department_name ⇒ Object (readonly)
Returns the value of attribute department_name
41 42 43 |
# File 'lib/postio/models.rb', line 41 def department_name @department_name end |
#dependent_locality ⇒ Object (readonly)
Returns the value of attribute dependent_locality
41 42 43 |
# File 'lib/postio/models.rb', line 41 def dependent_locality @dependent_locality end |
#dependent_thoroughfare ⇒ Object (readonly)
Returns the value of attribute dependent_thoroughfare
41 42 43 |
# File 'lib/postio/models.rb', line 41 def dependent_thoroughfare @dependent_thoroughfare end |
#district ⇒ Object (readonly)
Returns the value of attribute district
41 42 43 |
# File 'lib/postio/models.rb', line 41 def district @district end |
#double_dependent_locality ⇒ Object (readonly)
Returns the value of attribute double_dependent_locality
41 42 43 |
# File 'lib/postio/models.rb', line 41 def double_dependent_locality @double_dependent_locality end |
#eastings ⇒ Object (readonly)
Returns the value of attribute eastings
41 42 43 |
# File 'lib/postio/models.rb', line 41 def eastings @eastings end |
#latitude ⇒ Object (readonly)
Returns the value of attribute latitude
41 42 43 |
# File 'lib/postio/models.rb', line 41 def latitude @latitude end |
#longitude ⇒ Object (readonly)
Returns the value of attribute longitude
41 42 43 |
# File 'lib/postio/models.rb', line 41 def longitude @longitude end |
#northings ⇒ Object (readonly)
Returns the value of attribute northings
41 42 43 |
# File 'lib/postio/models.rb', line 41 def northings @northings end |
#organisation_name ⇒ Object (readonly)
Returns the value of attribute organisation_name
41 42 43 |
# File 'lib/postio/models.rb', line 41 def organisation_name @organisation_name end |
#po_box ⇒ Object (readonly)
Returns the value of attribute po_box
41 42 43 |
# File 'lib/postio/models.rb', line 41 def po_box @po_box end |
#post_town ⇒ Object (readonly)
Returns the value of attribute post_town
41 42 43 |
# File 'lib/postio/models.rb', line 41 def post_town @post_town end |
#postcode ⇒ Object (readonly)
Returns the value of attribute postcode
41 42 43 |
# File 'lib/postio/models.rb', line 41 def postcode @postcode end |
#postcode_inward ⇒ Object (readonly)
Returns the value of attribute postcode_inward
41 42 43 |
# File 'lib/postio/models.rb', line 41 def postcode_inward @postcode_inward end |
#postcode_outward ⇒ Object (readonly)
Returns the value of attribute postcode_outward
41 42 43 |
# File 'lib/postio/models.rb', line 41 def postcode_outward @postcode_outward end |
#postcode_type ⇒ Object (readonly)
Returns the value of attribute postcode_type
41 42 43 |
# File 'lib/postio/models.rb', line 41 def postcode_type @postcode_type end |
#sub_building_name ⇒ Object (readonly)
Returns the value of attribute sub_building_name
41 42 43 |
# File 'lib/postio/models.rb', line 41 def sub_building_name @sub_building_name end |
#thoroughfare ⇒ Object (readonly)
Returns the value of attribute thoroughfare
41 42 43 |
# File 'lib/postio/models.rb', line 41 def thoroughfare @thoroughfare end |
#udprn ⇒ Object (readonly)
Returns the value of attribute udprn
41 42 43 |
# File 'lib/postio/models.rb', line 41 def udprn @udprn end |
#ward ⇒ Object (readonly)
Returns the value of attribute ward
41 42 43 |
# File 'lib/postio/models.rb', line 41 def ward @ward end |
Class Method Details
.from_hash(h) ⇒ Object
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/postio/models.rb', line 50 def self.from_hash(h) new( udprn: h["udprn"].to_i, postcode: h["postcode"].to_s, postcode_outward: h["postcode_outward"], postcode_inward: h["postcode_inward"], postcode_type: h["postcode_type"], address_line_1: h["address_line_1"], address_line_2: h["address_line_2"], address_line_3: h["address_line_3"], post_town: h["post_town"], organisation_name: h["organisation_name"], department_name: h["department_name"], building_name: h["building_name"], building_number: h["building_number"], sub_building_name: h["sub_building_name"], po_box: h["po_box"], thoroughfare: h["thoroughfare"], dependent_thoroughfare: h["dependent_thoroughfare"], dependent_locality: h["dependent_locality"], double_dependent_locality: h["double_dependent_locality"], delivery_point_suffix: h["delivery_point_suffix"], country: h["country"], county: h["county"], district: h["district"], ward: h["ward"], latitude: h["latitude"]&.to_f, longitude: h["longitude"]&.to_f, eastings: h["eastings"]&.to_i, northings: h["northings"]&.to_i ) end |