Module: Perambulate

Defined in:
lib/perambulate.rb,
lib/perambulate/version.rb,
lib/perambulate/designations.rb,
lib/perambulate/parser/parser.rb,
lib/perambulate/address/address.rb,
lib/perambulate/lexer/aussie_lexer.rb

Defined Under Namespace

Classes: Address, Designations, Parser

Constant Summary collapse

VERSION =
"0.0.5"
AussieLexer =
Lexr.that {
  ignores /\s+/ => :whitespace

  matches /\d+/ => :number
  matches /Road|road|rd|Rd|RD/ => :designation
  matches /[,\/-]/ => :separator
  matches /[a-zA-Z]+/ => :place_word
}
@@configuration =
{:default_parser => "Australian"}

Class Method Summary collapse

Class Method Details

.configObject



11
12
13
# File 'lib/perambulate.rb', line 11

def self.config
  @@configuration
end

.configure {|@@configuration| ... } ⇒ Object

Yields:

  • (@@configuration)


15
16
17
# File 'lib/perambulate.rb', line 15

def self.configure(&block)
  yield @@configuration
end

.create_address(address_string) ⇒ Object



19
20
21
# File 'lib/perambulate.rb', line 19

def self.create_address(address_string)
  address = Perambulate::Parser.new().parse(address_string)
end