Class: MediaWiktory::Wikipedia::Actions::Login

Inherits:
Post
  • Object
show all
Defined in:
lib/mediawiktory/wikipedia/actions/login.rb

Overview

Log in and get authentication cookies.

Usage:

api..name(value).perform # returns string with raw output
# or
api..name(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 Post

#perform

Methods inherited from Base

#inspect, #merge, #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

#domain(value) ⇒ self

Domain (optional).

Parameters:

  • value (String)

Returns:

  • (self)


42
43
44
# File 'lib/mediawiktory/wikipedia/actions/login.rb', line 42

def domain(value)
  merge(lgdomain: value.to_s)
end

#name(value) ⇒ self

User name.

Parameters:

  • value (String)

Returns:

  • (self)


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

def name(value)
  merge(lgname: value.to_s)
end

#password(value) ⇒ self

Password.

Parameters:

  • value (String)

Returns:

  • (self)


34
35
36
# File 'lib/mediawiktory/wikipedia/actions/login.rb', line 34

def password(value)
  merge(lgpassword: value.to_s)
end

#token(value) ⇒ self

A "login" token retrieved from action=query&meta=tokens

Parameters:

  • value (String)

Returns:

  • (self)


50
51
52
# File 'lib/mediawiktory/wikipedia/actions/login.rb', line 50

def token(value)
  merge(lgtoken: value.to_s)
end