Class: MediaWiktory::Wikipedia::Actions::Login
- Defined in:
- lib/mediawiktory/wikipedia/actions/login.rb
Overview
Log in and get authentication cookies.
Usage:
api.login.name(value).perform # returns string with raw output
# or
api.login.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
-
#domain(value) ⇒ self
Domain (optional).
-
#name(value) ⇒ self
User name.
-
#password(value) ⇒ self
Password.
-
#token(value) ⇒ self
A "login" token retrieved from action=query&meta=tokens.
Methods inherited from Post
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).
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.
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.
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
50 51 52 |
# File 'lib/mediawiktory/wikipedia/actions/login.rb', line 50 def token(value) merge(lgtoken: value.to_s) end |