| Class | Mediawiki::Text |
| In: |
mediawiki/core.rb
|
| Parent: | Object |
| DeletedText | = | '<deleted>' |
| flags | [R] |
text flags: this could be
|
||||||
| internal_links | [R] | Array of all internal links found in the Text as strings | ||||||
| tid | [R] | the text id |
creates a new Text. wiki is the Wiki the revision belongs to, all other parameters correspond to the fields in the corresponding database table.
# File mediawiki/core.rb, line 1149 def initialize(wiki, tid, text, flags, keeptext=true) @wiki = wiki @tid = tid @text = text @flags = flags @internal_links = [] parse_text @text = DeletedText unless keeptext end
iterator over all links found in the text given as strings. For a link iterator giving Page objects please see the corresponding Revision object (as Text objects do not have timestamps we need to decide whether a link is dangling)
# File mediawiki/core.rb, line 1180 def each_link(&block) @internal_links.each(&block) end
Text obliteration.
Sets the following instance_variables to obliterated values unless the corresponding keeps are set to true:
| text : | unless :text => true |
| links : | unless :links => true |
# File mediawiki/core.rb, line 1207 def obliterate(keeps={}) @text = '' unless keeps[:text] @internal_links.collect! { |l| 'link' } unless keeps[:links] end