Class: MediaWiki::MediaWikiBase

Inherits:
Object
  • Object
show all
Defined in:
lib/mediawiki.rb

Defined Under Namespace

Classes: Page, Revision

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url) ⇒ MediaWikiBase

Returns a new instance of MediaWikiBase.



101
102
103
104
# File 'lib/mediawiki.rb', line 101

def initialize(url)
  @xml = get_xml(url)
  @pages = (@xml/:api/:query/:pages/:page).collect{|p| Page.new(p) }
end

Instance Attribute Details

#pagesObject

Returns the value of attribute pages.



99
100
101
# File 'lib/mediawiki.rb', line 99

def pages
  @pages
end

#xmlObject

Returns the value of attribute xml.



99
100
101
# File 'lib/mediawiki.rb', line 99

def xml
  @xml
end