Sha256: ecb8236dbecd6abd2975ec202df7d312fe8511a47205170f752a76de07c01d3d

Contents?: true

Size: 1015 Bytes

Versions: 4

Compression:

Stored size: 1015 Bytes

Contents

# frozen_string_literal: true

module MediaWiktory::Wikipedia
  module Actions
    # Validate one or more URLs against the SpamBlacklist.
    #
    # Usage:
    #
    # ```ruby
    # api.spamblacklist.url(value).perform # returns string with raw output
    # # or
    # api.spamblacklist.url(value).response # returns output parsed and wrapped into Response object
    # ```
    #
    # See {Base} for generic explanation of working with MediaWiki actions and
    # {MediaWiktory::Wikipedia::Response} for working with action responses.
    #
    # All action's parameters are documented as its public methods, see below.
    #
    class Spamblacklist < MediaWiktory::Wikipedia::Actions::Get

      # URLs to validate against the blacklist.
      #
      # @param values [Array<String>]
      # @return [self]
      def url(*values)
        values.inject(self) { |res, val| res._url(val) }
      end

      # @private
      def _url(value)
        merge(url: value.to_s, replace: false)
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
mediawiktory-0.1.3 lib/mediawiktory/wikipedia/actions/spamblacklist.rb
mediawiktory-0.1.2 lib/mediawiktory/wikipedia/actions/spamblacklist.rb
mediawiktory-0.1.1 lib/mediawiktory/wikipedia/actions/spamblacklist.rb
mediawiktory-0.1.0 lib/mediawiktory/wikipedia/actions/spamblacklist.rb