Module: Paf::ThoroughfareLocality

Defined in:
lib/paf/thoroughfare_locality.rb

Overview

Processing for thoroughfare and locality elements of a PAF entry

Instance Method Summary collapse

Instance Method Details

#thoroughfare_and_locality_attrsObject



4
5
6
# File 'lib/paf/thoroughfare_locality.rb', line 4

def thoroughfare_and_locality_attrs
  %i[dependent_thoroughfare thoroughfare] + self.class.locality_attrs
end

#thoroughfares_and_localitiesObject



8
9
10
11
12
13
14
15
16
# File 'lib/paf/thoroughfare_locality.rb', line 8

def thoroughfares_and_localities
  [].tap do |array|
    thoroughfare_and_locality_attrs.each do |attr|
      next if used?(attr)
      value = send(attr)
      array << value unless value.vacant?
    end
  end
end