class Wiki

Public Class Methods

new() click to toggle source
# File lib/wiki_fetch.rb, line 6
      def initialize()
              @@agent = Mechanize.new
end

Public Instance Methods

fetch_url(url) click to toggle source
# File lib/wiki_fetch.rb, line 20
def fetch_url(url)
        begin
                page_data = @@agent.get url
                return page_data.body
        rescue => e
                e.message
        end
end
search_suggestions(name, options = {}) click to toggle source
# File lib/wiki_fetch.rb, line 15
def search_suggestions(name, options = {})
        url = UrlFormatter.create_url({:name => name, :method => "search_suggestions", :options => options})
        fetch_url(url)
end
search_title(name, options = {}) click to toggle source
# File lib/wiki_fetch.rb, line 10
def search_title(name, options = {})
        url = UrlFormatter.create_url({:name => name, :method => "search_title", :options => options})
        fetch_url(url)
end