Class: Paf::Address

Inherits:
Object
  • Object
show all
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

Methods included from Formattable

#format

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_thoroughfareObject

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_boxObject

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

#thoroughfareObject

Thoroughfare name and descriptor



28
29
30
# File 'lib/paf/address.rb', line 28

def thoroughfare
  concatenated(self.class.thoroughfare_attrs)
end