Class: MediaWiki::MediaWikiBase::Page
- Inherits:
-
Object
- Object
- MediaWiki::MediaWikiBase::Page
- Defined in:
- lib/mediawiki.rb
Overview
Page encapsulates the properties of wikipedia page.
Instance Attribute Summary collapse
-
#pageid ⇒ Object
Returns the value of attribute pageid.
-
#title ⇒ Object
Returns the value of attribute title.
Instance Method Summary collapse
-
#initialize(page) ⇒ Page
constructor
A new instance of Page.
Constructor Details
#initialize(page) ⇒ Page
Returns a new instance of Page.
112 113 114 115 116 117 118 119 120 121 |
# File 'lib/mediawiki.rb', line 112 def initialize(page) @title = page.attributes['title'] @pageid = page.attributes['pageid'] @links = (page/:links/:pl).collect{|pl| pl.attributes['title']} @langlinks = (page/:langlinks/:ll).collect{|ll| ll.attributes['lang']} @images = (page/:images/:im).collect{|im| im.attributes['title']} @templates = (page/:templates/:tl).collect{|tl| tl.attributes['title']} @extlinks = (page/:extlinks/:el).collect{|el| el.inner_html} @revisions = (page/:revisions/:rev).collect{|rev| Revision.new(rev)} end |
Instance Attribute Details
#pageid ⇒ Object
Returns the value of attribute pageid.
110 111 112 |
# File 'lib/mediawiki.rb', line 110 def pageid @pageid end |
#title ⇒ Object
Returns the value of attribute title.
110 111 112 |
# File 'lib/mediawiki.rb', line 110 def title @title end |