Class: MediaWiktory::Wikipedia::Actions::Compare

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

Overview

Get the difference between 2 pages.

Usage:

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

#fromid(value) ⇒ self

First page ID to compare.

Parameters:

  • value (Integer)

Returns:

  • (self)


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

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

#fromrev(value) ⇒ self

First revision to compare.

Parameters:

  • value (Integer)

Returns:

  • (self)


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

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

#fromtitle(value) ⇒ self

First title to compare.

Parameters:

  • value (String)

Returns:

  • (self)


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

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

#toid(value) ⇒ self

Second page ID to compare.

Parameters:

  • value (Integer)

Returns:

  • (self)


58
59
60
# File 'lib/mediawiktory/wikipedia/actions/compare.rb', line 58

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

#torev(value) ⇒ self

Second revision to compare.

Parameters:

  • value (Integer)

Returns:

  • (self)


66
67
68
# File 'lib/mediawiktory/wikipedia/actions/compare.rb', line 66

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

#totitle(value) ⇒ self

Second title to compare.

Parameters:

  • value (String)

Returns:

  • (self)


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

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