class ToTown::CLI

Public Instance Methods

check() click to toggle source
# File lib/to_town/cli.rb, line 20
def check
  points = ToTown.check(options[:lat].to_f, options[:lng].to_f, options[:limit])
        points.each do |point|
          puts %{ #{point.name} #{point.state}\t
                  type: #{point.town_type}\t
                  latitude: #{point.latlng[0]}\t
                  longitude: #{point.latlng[1]}\t
                  land area: #{point.aland}\t
                  water area: #{point.awater}
                }
        end
end
config(db_name='mongo') click to toggle source
# File lib/to_town/cli.rb, line 34
def config(db_name='mongo')
  case db_name
  when "mongo"
    ToTown::Generators::Mongodb.start
  end
end
populate() click to toggle source
# File lib/to_town/cli.rb, line 12
def populate
  ToTown::Converter::Us.run
end