Module: MediaWiktory::Wikipedia::Modules::GGeosearch
- Defined in:
- lib/mediawiktory/wikipedia/modules/g-geosearch.rb
Overview
Returns pages having coordinates that are located in a certain area. Generator module: for fetching pages corresponding to request.
The "submodule" (MediaWiki API term) is included in action after setting some param, providing additional tweaking for this param. Example (for Actions::Query and its submodules):
api.query # returns Actions::Query
.prop(:revisions) # adds prop=revisions to action URL, and includes Modules::Revisions into action
.limit(10) # method of Modules::Revisions, adds rvlimit=10 to URL
All submodule's parameters are documented as its public methods, see below.
Instance Method Summary collapse
-
#bbox(value) ⇒ self
Bounding box to search in: pipe (|) separated coordinates of top left and bottom right corners.
-
#coord(value) ⇒ self
Coordinate around which to search.
-
#debug ⇒ self
Whether debug information should be returned.
-
#globe(value) ⇒ self
Globe to search on (by default "earth").
-
#limit(value) ⇒ self
Maximum number of pages to return.
-
#maxdim(value) ⇒ self
Restrict search to objects no larger than this, in meters.
-
#namespace(*values) ⇒ self
Namespaces to search.
-
#page(value) ⇒ self
Title of page around which to search.
-
#primary(value) ⇒ self
Whether to return only primary coordinates ("primary"), secondary ("secondary") or both ("all").
-
#radius(value) ⇒ self
Search radius in meters.
Instance Method Details
#bbox(value) ⇒ self
Bounding box to search in: pipe (|) separated coordinates of top left and bottom right corners.
41 42 43 |
# File 'lib/mediawiktory/wikipedia/modules/g-geosearch.rb', line 41 def bbox(value) merge(ggsbbox: value.to_s) end |
#coord(value) ⇒ self
Coordinate around which to search.
25 26 27 |
# File 'lib/mediawiktory/wikipedia/modules/g-geosearch.rb', line 25 def coord(value) merge(ggscoord: value.to_s) end |
#debug ⇒ self
Whether debug information should be returned.
111 112 113 |
# File 'lib/mediawiktory/wikipedia/modules/g-geosearch.rb', line 111 def debug() merge(ggsdebug: 'true') end |
#globe(value) ⇒ self
Globe to search on (by default "earth").
73 74 75 |
# File 'lib/mediawiktory/wikipedia/modules/g-geosearch.rb', line 73 def globe(value) _globe(value) or fail ArgumentError, "Unknown value for globe: #{value}" end |
#limit(value) ⇒ self
Maximum number of pages to return.
65 66 67 |
# File 'lib/mediawiktory/wikipedia/modules/g-geosearch.rb', line 65 def limit(value) merge(ggslimit: value.to_s) end |
#maxdim(value) ⇒ self
Restrict search to objects no larger than this, in meters.
57 58 59 |
# File 'lib/mediawiktory/wikipedia/modules/g-geosearch.rb', line 57 def maxdim(value) merge(ggsmaxdim: value.to_s) end |
#namespace(*values) ⇒ self
Namespaces to search.
86 87 88 |
# File 'lib/mediawiktory/wikipedia/modules/g-geosearch.rb', line 86 def namespace(*values) values.inject(self) { |res, val| res._namespace(val) or fail ArgumentError, "Unknown value for namespace: #{val}" } end |
#page(value) ⇒ self
Title of page around which to search.
33 34 35 |
# File 'lib/mediawiktory/wikipedia/modules/g-geosearch.rb', line 33 def page(value) merge(ggspage: value.to_s) end |
#primary(value) ⇒ self
Whether to return only primary coordinates ("primary"), secondary ("secondary") or both ("all").
99 100 101 |
# File 'lib/mediawiktory/wikipedia/modules/g-geosearch.rb', line 99 def primary(value) _primary(value) or fail ArgumentError, "Unknown value for primary: #{value}" end |
#radius(value) ⇒ self
Search radius in meters.
49 50 51 |
# File 'lib/mediawiktory/wikipedia/modules/g-geosearch.rb', line 49 def radius(value) merge(ggsradius: value.to_s) end |