Sha256: 860707047452c4b4b2d00c6c682c96c638a3f89f1ee0727a309b127c2c1d3bfe

Contents?: true

Size: 401 Bytes

Versions: 7

Compression:

Stored size: 401 Bytes

Contents

module GeoNamesAPI
  class PlaceSearch < ListEndpoint

    METHOD = 'searchJSON'
    FIND_PARAMS = %w(q maxRows)
    DEFAULT_MAX_ROWS = 100

    def self.find_by_place_name(name, max_rows = DEFAULT_MAX_ROWS)
      where(name: name, maxRows: max_rows)
    end

    def self.find_by_exact_place_name(name, max_rows = DEFAULT_MAX_ROWS)
      where(name_equals: name, maxRows: max_rows)
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
geonames_api-0.1.6 lib/geonames_api/place_search.rb
geonames_api-0.1.5 lib/geonames_api/place_search.rb
geonames_api-0.1.4 lib/geonames_api/place_search.rb
geonames_api-0.1.3 lib/geonames_api/place_search.rb
geonames_api-0.1.2 lib/geonames_api/place_search.rb
geonames_api-0.1.1 lib/geonames_api/place_search.rb
geonames_api-0.1.0 lib/geonames_api/place_search.rb