Class: PicturehouseUk::Internal::Parser::Address Private
- Inherits:
-
Object
- Object
- PicturehouseUk::Internal::Parser::Address
- Defined in:
- lib/picturehouse_uk/internal/parser/address.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Parses a chunk of HTML to derive address
Instance Method Summary collapse
-
#address ⇒ Hash
private
:postal_code, :country.
- #initialize(html) ⇒ PicturehouseUk::Internal::AddressParser constructor private
Constructor Details
#initialize(html) ⇒ PicturehouseUk::Internal::AddressParser
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
9 10 11 |
# File 'lib/picturehouse_uk/internal/parser/address.rb', line 9 def initialize(html) @html = html.to_s end |
Instance Method Details
#address ⇒ Hash
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Note:
Uses the address naming from microformats.org/wiki/adr
:postal_code, :country
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/picturehouse_uk/internal/parser/address.rb', line 16 def address { street_address: array[1], extended_address: extended_address, locality: town, region: region, postal_code: postal_code, country_name: 'United Kingdom'.freeze } end |