Class: Infoboxer::MediaWiki::Page
- Inherits:
-
Tree::Document
- Object
- Tree::Node
- Tree::Compound
- Tree::Document
- Infoboxer::MediaWiki::Page
- Defined in:
- lib/infoboxer/media_wiki/page.rb
Overview
A descendant of Document, representing page, received from Infoboxer::MediaWiki client.
Alongside with document tree structure, knows document's title as represented by MediaWiki and human (non-API) URL.
Instance Attribute Summary collapse
-
#client ⇒ MediaWiki
readonly
Instance of Infoboxer::MediaWiki which this page was received from.
-
#source ⇒ MediaWiktory::Page
readonly
Instance of MediaWiktory::Page class with source data.
-
#title ⇒ String
readonly
Page title.
-
#url ⇒ String
readonly
Page friendly URL.
Attributes inherited from Tree::Compound
Attributes inherited from Tree::Node
Instance Method Summary collapse
-
#initialize(client, children, source) ⇒ Page
constructor
A new instance of Page.
- #traits ⇒ Object
Methods included from Navigation::Sections::Container
Methods inherited from Tree::Compound
Methods inherited from Tree::Node
#==, #children, coder, def_readers, #index, #inspect, #next_siblings, #prev_siblings, #siblings, #text, #text_, #to_s, #to_tree
Methods included from Navigation::Sections::Node
Methods included from Navigation::Shortcuts::Node
#bold?, #categories, #external_links, #heading?, #headings, #images, #infobox, #infoboxes, #italic?, #lists, #paragraphs, #tables, #templates, #wikilinks
Methods included from Navigation::Lookup::Node
#_lookup, #_lookup_children, #_lookup_next_siblings, #_lookup_parents, #_lookup_prev_siblings, #_lookup_siblings, #_matches?, #has_parent?, #lookup, #lookup_children, #lookup_next_siblings, #lookup_parents, #lookup_prev_siblings, #lookup_siblings, #matches?
Constructor Details
#initialize(client, children, source) ⇒ Page
Returns a new instance of Page.
10 11 12 13 |
# File 'lib/infoboxer/media_wiki/page.rb', line 10 def initialize(client, children, source) @client, @source = client, source super(children, title: source.title, url: source.fullurl) end |
Instance Attribute Details
#client ⇒ MediaWiki (readonly)
Instance of Infoboxer::MediaWiki which this page was received from
17 18 19 |
# File 'lib/infoboxer/media_wiki/page.rb', line 17 def client @client end |
#source ⇒ MediaWiktory::Page (readonly)
Instance of MediaWiktory::Page class with source data
21 22 23 |
# File 'lib/infoboxer/media_wiki/page.rb', line 21 def source @source end |
#title ⇒ String (readonly)
Page title.
|
# File 'lib/infoboxer/media_wiki/page.rb', line 23
|
#url ⇒ String (readonly)
Page friendly URL.
31 |
# File 'lib/infoboxer/media_wiki/page.rb', line 31 def_readers :title, :url |
Instance Method Details
#traits ⇒ Object
33 34 35 |
# File 'lib/infoboxer/media_wiki/page.rb', line 33 def traits client.traits end |