Class: Wikiscript::Page
- Inherits:
-
Object
- Object
- Wikiscript::Page
- Includes:
- LogUtils::Logging
- Defined in:
- lib/wikiscript/page.rb
Instance Attribute Summary collapse
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
- #download_text ⇒ Object
-
#initialize(title, text: nil) ⇒ Page
constructor
A new instance of Page.
-
#parse ⇒ Object
todo/change: use/find a different name e.g.
- #text ⇒ Object
Constructor Details
#initialize(title, text: nil) ⇒ Page
11 12 13 14 15 16 17 18 |
# File 'lib/wikiscript/page.rb', line 11 def initialize( title, text: nil ) ## todo: check title ## replace title spaces w/ _ ???? ## to allow "pretty" titles - why? why not?? @title = title @text = text end |
Instance Attribute Details
#title ⇒ Object (readonly)
Returns the value of attribute title.
9 10 11 |
# File 'lib/wikiscript/page.rb', line 9 def title @title end |
Instance Method Details
#download_text ⇒ Object
24 25 26 |
# File 'lib/wikiscript/page.rb', line 24 def download_text Client.new.text( @title ) end |
#parse ⇒ Object
todo/change: use/find a different name e.g. doc/elements/etc. - why? why not?
28 29 30 |
# File 'lib/wikiscript/page.rb', line 28 def parse ## todo/change: use/find a different name e.g. doc/elements/etc. - why? why not? PageReader.parse( text ) end |
#text ⇒ Object
20 21 22 |
# File 'lib/wikiscript/page.rb', line 20 def text @text ||= download_text # cache text (from request) end |