class WikipediaWrapper::PageError

Exception raised when no Wikipedia matched a query.

Public Class Methods

new(term, pageid: false) click to toggle source
# File lib/wikipedia_wrapper/exception.rb, line 47
def initialize(term, pageid: false)
  @pageid = pageid
  @term = term
end

Public Instance Methods

message() click to toggle source
# File lib/wikipedia_wrapper/exception.rb, line 52
def message
  if @pageid
    "Page id \"#{@term}\" does not match any pages. Try another id!"
  else
    "\"#{@term}\" does not match any pages. Try another query!"
  end
end