Class: MediaWiktory::Wikipedia::Actions::Featuredfeed

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

Overview

Returns a featured content feed.

Usage:

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

#feed(value) ⇒ self

Feed name.

Parameters:

  • value (String)

    One of "potd", "featured", "onthisday".

Returns:

  • (self)


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

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

#feedformat(value) ⇒ self

The format of the feed.

Parameters:

  • value (String)

    One of "rss", "atom".

Returns:

  • (self)


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

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

#language(value) ⇒ self

Feed language code. Ignored by some feeds.

Parameters:

  • value (String)

Returns:

  • (self)


52
53
54
# File 'lib/mediawiktory/wikipedia/actions/featuredfeed.rb', line 52

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