Class: MediaWiktory::Wikipedia::Actions::Zeroconfig

Inherits:
Get
  • Object
show all
Defined in:
lib/mediawiktory/wikipedia/actions/zeroconfig.rb

Overview

Get configuration of the Zero extension.

Usage:

api.zeroconfig.type(value).perform # returns string with raw output
# or
api.zeroconfig.type(value).response # returns output parsed and wrapped into Response object

See Base for generic explanation of working with MediaWiki actions and Response for working with action responses.

All action's parameters are documented as its public methods, see below.

Instance Method Summary collapse

Methods inherited from Get

#perform

Methods inherited from Base

#inspect, #merge, #name, #perform, #response, #to_h, #to_param, #to_url

Methods included from GlobalParams

#assert, #assertuser, #centralauthtoken, #curtimestamp, #errorformat, #errorlang, #errorsuselocal, #format, #maxage, #maxlag, #origin, #requestid, #responselanginfo, #servedby, #smaxage, #uselang

Instance Method Details

#agent(value) ⇒ self

When setting type to message, include a source agent value as well.

Parameters:

  • value (String)

Returns:

  • (self)


39
40
41
# File 'lib/mediawiktory/wikipedia/actions/zeroconfig.rb', line 39

def agent(value)
  merge(agent: value.to_s)
end

#type(value) ⇒ self

What kind of Zero info is needed:

Parameters:

  • value (String)

    One of "config" (Get a trimmed-down carrier configuration based on the X-CS header), "message" (Get language-appropriate verbiage based on X-CS header; requires agent param).

Returns:

  • (self)


26
27
28
# File 'lib/mediawiktory/wikipedia/actions/zeroconfig.rb', line 26

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