Module: MediaWiktory::Wikipedia::Modules::GAllcategories

Defined in:
lib/mediawiktory/wikipedia/modules/g-allcategories.rb

Overview

Enumerate all categories. 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

Instance Method Details

#continue(value) ⇒ self

When more results are available, use this to continue.

Parameters:

  • value (String)

Returns:

  • (self)


33
34
35
# File 'lib/mediawiktory/wikipedia/modules/g-allcategories.rb', line 33

def continue(value)
  merge(gaccontinue: value.to_s)
end

#dir(value) ⇒ self

Direction to sort in.

Parameters:

  • value (String)

    One of "ascending", "descending".

Returns:

  • (self)


57
58
59
# File 'lib/mediawiktory/wikipedia/modules/g-allcategories.rb', line 57

def dir(value)
  _dir(value) or fail ArgumentError, "Unknown value for dir: #{value}"
end

#from(value) ⇒ self

The category to start enumerating from.

Parameters:

  • value (String)

Returns:

  • (self)


25
26
27
# File 'lib/mediawiktory/wikipedia/modules/g-allcategories.rb', line 25

def from(value)
  merge(gacfrom: value.to_s)
end

#limit(value) ⇒ self

How many categories to return.

Parameters:

  • value (Integer, "max")

Returns:

  • (self)


86
87
88
# File 'lib/mediawiktory/wikipedia/modules/g-allcategories.rb', line 86

def limit(value)
  merge(gaclimit: value.to_s)
end

#max(value) ⇒ self

Only return categories with at most this many members.

Parameters:

  • value (Integer)

Returns:

  • (self)


78
79
80
# File 'lib/mediawiktory/wikipedia/modules/g-allcategories.rb', line 78

def max(value)
  merge(gacmax: value.to_s)
end

#min(value) ⇒ self

Only return categories with at least this many members.

Parameters:

  • value (Integer)

Returns:

  • (self)


70
71
72
# File 'lib/mediawiktory/wikipedia/modules/g-allcategories.rb', line 70

def min(value)
  merge(gacmin: value.to_s)
end

#prefix(value) ⇒ self

Search for all category titles that begin with this value.

Parameters:

  • value (String)

Returns:

  • (self)


49
50
51
# File 'lib/mediawiktory/wikipedia/modules/g-allcategories.rb', line 49

def prefix(value)
  merge(gacprefix: value.to_s)
end

#to(value) ⇒ self

The category to stop enumerating at.

Parameters:

  • value (String)

Returns:

  • (self)


41
42
43
# File 'lib/mediawiktory/wikipedia/modules/g-allcategories.rb', line 41

def to(value)
  merge(gacto: value.to_s)
end