Module: MediaWiktory::Wikipedia::Modules::GProjectpages

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

Overview

List all pages associated with one or more projects. 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

#assessmentsself

Also return assessments for the pages returned.

Returns:

  • (self)


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

def assessments()
  merge(gwppassessments: 'true')
end

#continue(value) ⇒ self

When more results are available, use this to continue.

Parameters:

  • value (String)

Returns:

  • (self)


53
54
55
# File 'lib/mediawiktory/wikipedia/modules/g-projectpages.rb', line 53

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

#limit(value) ⇒ self

The maximum number of pages to return.

Parameters:

  • value (Integer, "max")

Returns:

  • (self)


45
46
47
# File 'lib/mediawiktory/wikipedia/modules/g-projectpages.rb', line 45

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

#projects(*values) ⇒ self

The projects to list pages for. If this parameter is omitted, all projects will be included.

Parameters:

  • values (Array<String>)

Returns:

  • (self)


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

def projects(*values)
  values.inject(self) { |res, val| res._projects(val) }
end