class CitySearch

Public Instance Methods

db() click to toggle source
# File lib/city_search.rb, line 21
def db
  @all ||= Dawg.load(File.join(data_path, 'russia.bin'))
end
states() click to toggle source
# File lib/city_search.rb, line 25
def states
  @states ||= Marshal.load(
    File.read(File.join(data_path, 'subdivisions.bin'))
  )
end

Private Instance Methods

data_path() click to toggle source
# File lib/city_search.rb, line 33
def data_path
  @data_path ||= File.join(File.dirname(__FILE__), '/../data')
end