module MediaWiktory::Wikipedia::Modules::GGeosearch

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 {MediaWiktory::Wikipedia::Actions::Query} and its submodules):

“`ruby 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.

Public Instance Methods

_globe(value) click to toggle source

@private

Calls superclass method
# File lib/mediawiktory/wikipedia/modules/g-geosearch.rb, line 78
def _globe(value)
  defined?(super) && super || ["earth"].include?(value.to_s) && merge(ggsglobe: value.to_s)
end
_namespace(value) click to toggle source

@private

Calls superclass method
# File lib/mediawiktory/wikipedia/modules/g-geosearch.rb, line 91
def _namespace(value)
  defined?(super) && super || ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "100", "101", "108", "109", "118", "119", "446", "447", "710", "711", "828", "829", "2300", "2301", "2302", "2303"].include?(value.to_s) && merge(ggsnamespace: value.to_s, replace: false)
end
_primary(value) click to toggle source

@private

Calls superclass method
# File lib/mediawiktory/wikipedia/modules/g-geosearch.rb, line 104
def _primary(value)
  defined?(super) && super || ["primary", "secondary", "all"].include?(value.to_s) && merge(ggsprimary: value.to_s)
end
bbox(value) click to toggle source

Bounding box to search in: pipe (|) separated coordinates of top left and bottom right corners.

@param value [String] @return [self]

# File lib/mediawiktory/wikipedia/modules/g-geosearch.rb, line 41
def bbox(value)
  merge(ggsbbox: value.to_s)
end
coord(value) click to toggle source

Coordinate around which to search.

@param value [String] @return [self]

# File lib/mediawiktory/wikipedia/modules/g-geosearch.rb, line 25
def coord(value)
  merge(ggscoord: value.to_s)
end
debug() click to toggle source

Whether debug information should be returned.

@return [self]

# File lib/mediawiktory/wikipedia/modules/g-geosearch.rb, line 111
def debug()
  merge(ggsdebug: 'true')
end
globe(value) click to toggle source

Globe to search on (by default “earth”).

@param value [String] One of “earth”. @return [self]

# 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) click to toggle source

Maximum number of pages to return.

@param value [Integer, “max”] @return [self]

# File lib/mediawiktory/wikipedia/modules/g-geosearch.rb, line 65
def limit(value)
  merge(ggslimit: value.to_s)
end
maxdim(value) click to toggle source

Restrict search to objects no larger than this, in meters.

@param value [Integer] @return [self]

# File lib/mediawiktory/wikipedia/modules/g-geosearch.rb, line 57
def maxdim(value)
  merge(ggsmaxdim: value.to_s)
end
namespace(*values) click to toggle source

Namespaces to search.

@param values [Array<String>] Allowed values: “0”, “1”, “2”, “3”, “4”, “5”, “6”, “7”, “8”, “9”, “10”, “11”, “12”, “13”, “14”, “15”, “100”, “101”, “108”, “109”, “118”, “119”, “446”, “447”, “710”, “711”, “828”, “829”, “2300”, “2301”, “2302”, “2303”. @return [self]

# 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) click to toggle source

Title of page around which to search.

@param value [String] @return [self]

# File lib/mediawiktory/wikipedia/modules/g-geosearch.rb, line 33
def page(value)
  merge(ggspage: value.to_s)
end
primary(value) click to toggle source

Whether to return only primary coordinates (“primary”), secondary (“secondary”) or both (“all”).

@param value [String] One of “primary”, “secondary”, “all”. @return [self]

# 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) click to toggle source

Search radius in meters.

@param value [Integer] @return [self]

# File lib/mediawiktory/wikipedia/modules/g-geosearch.rb, line 49
def radius(value)
  merge(ggsradius: value.to_s)
end