Class: GeoNamesAPI::PlaceSearch
- Inherits:
-
ListEndpoint
- Object
- Entity
- Base
- ListEndpoint
- GeoNamesAPI::PlaceSearch
- Defined in:
- lib/geonames_api/place_search.rb
Constant Summary collapse
- METHOD =
'searchJSON'
- FIND_PARAMS =
%w(q maxRows)
- DEFAULT_MAX_ROWS =
100
Instance Attribute Summary
Attributes inherited from Entity
Class Method Summary collapse
- .find_by_exact_place_name(name, max_rows = DEFAULT_MAX_ROWS) ⇒ Object
- .find_by_place_name(name, max_rows = DEFAULT_MAX_ROWS) ⇒ Object
Methods inherited from ListEndpoint
endpoint_returns_list?, #next_page, #to_page
Methods inherited from Base
Methods inherited from Entity
#create_attribute, #initialize, #marshal_dump, #marshal_load, #parse_attr, #parse_response, #set_default_type
Constructor Details
This class inherits a constructor from GeoNamesAPI::Entity
Class Method Details
.find_by_exact_place_name(name, max_rows = DEFAULT_MAX_ROWS) ⇒ Object
12 13 14 |
# File 'lib/geonames_api/place_search.rb', line 12 def self.find_by_exact_place_name(name, max_rows = DEFAULT_MAX_ROWS) where(name_equals: name, maxRows: max_rows) end |
.find_by_place_name(name, max_rows = DEFAULT_MAX_ROWS) ⇒ Object
8 9 10 |
# File 'lib/geonames_api/place_search.rb', line 8 def self.find_by_place_name(name, max_rows = DEFAULT_MAX_ROWS) where(name: name, maxRows: max_rows) end |