class Wikipedia::Url

Public Class Methods

new(wiki_url) click to toggle source
# File lib/wikipedia/url.rb, line 6
def initialize(wiki_url)
  @wiki_url = wiki_url
end

Public Instance Methods

title() click to toggle source
# File lib/wikipedia/url.rb, line 10
def title
  return @title if @title

  uri     = URI.parse( @wiki_url )
  @title  =
    if uri.path.empty?
      @wiki_url
    else
      Addressable::URI.unencode( uri.path.sub(/\/wiki\//, '') )
    end
end