Class: Paf::Address
- Inherits:
-
Object
- Object
- Paf::Address
- Includes:
- Attribute, Formattable
- Defined in:
- lib/paf/address.rb
Overview
Base class from the elements of a UK Royal Mail Postcode Address File entry
Instance Attribute Summary
Attributes included from Formattable
#concatenation_indicator, #formatter
Instance Method Summary collapse
-
#dependent_thoroughfare ⇒ Object
Dependent thoroughfare name and descriptor.
-
#initialize(args) ⇒ Address
constructor
A new instance of Address.
-
#po_box ⇒ Object
PO Box number prepended with the string PO BOX.
-
#thoroughfare ⇒ Object
Thoroughfare name and descriptor.
Methods included from Formattable
Constructor Details
#initialize(args) ⇒ Address
Returns a new instance of Address.
13 14 15 |
# File 'lib/paf/address.rb', line 13 def initialize(args) args.each { |k, v| send("#{k}=", v) } end |
Instance Method Details
#dependent_thoroughfare ⇒ Object
Dependent thoroughfare name and descriptor
23 24 25 |
# File 'lib/paf/address.rb', line 23 def dependent_thoroughfare concatenated(self.class.dependent_thoroughfare_attrs) end |
#po_box ⇒ Object
PO Box number prepended with the string PO BOX
18 19 20 |
# File 'lib/paf/address.rb', line 18 def po_box "PO BOX #{po_box_number}" unless po_box_number.vacant? end |
#thoroughfare ⇒ Object
Thoroughfare name and descriptor
28 29 30 |
# File 'lib/paf/address.rb', line 28 def thoroughfare concatenated(self.class.thoroughfare_attrs) end |