Class: ZhSieve::HTMLPage
- Inherits:
-
Object
- Object
- ZhSieve::HTMLPage
- Includes:
- Converter
- Defined in:
- lib/zhSieve/htmlpage.rb
Instance Attribute Summary collapse
-
#answer_id ⇒ Object
Returns the value of attribute answer_id.
-
#article_id ⇒ Object
Returns the value of attribute article_id.
-
#contents ⇒ Object
Returns the value of attribute contents.
-
#question_id ⇒ Object
Returns the value of attribute question_id.
Instance Method Summary collapse
- #answerMarkdown ⇒ Object
- #articleMarkdown ⇒ Object
-
#initialize(options) ⇒ HTMLPage
constructor
A new instance of HTMLPage.
- #markdown ⇒ Object
- #markdown! ⇒ Object
- #peopleMarkdown ⇒ Object
- #to_html ⇒ Object
Methods included from Converter
#answer_to_markdown, #article_to_markdown, #debug, #method_missing, #parse_element, #people_to_markdown, #to_markdown, #wrap_node
Constructor Details
#initialize(options) ⇒ HTMLPage
Returns a new instance of HTMLPage.
7 8 9 10 11 12 |
# File 'lib/zhSieve/htmlpage.rb', line 7 def initialize() @contents = [:contents].body @question_id = [:question_id] @answer_id = [:answer_id] @article_id = [:article_id] end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class ZhSieve::Converter
Instance Attribute Details
#answer_id ⇒ Object
Returns the value of attribute answer_id.
5 6 7 |
# File 'lib/zhSieve/htmlpage.rb', line 5 def answer_id @answer_id end |
#article_id ⇒ Object
Returns the value of attribute article_id.
5 6 7 |
# File 'lib/zhSieve/htmlpage.rb', line 5 def article_id @article_id end |
#contents ⇒ Object
Returns the value of attribute contents.
5 6 7 |
# File 'lib/zhSieve/htmlpage.rb', line 5 def contents @contents end |
#question_id ⇒ Object
Returns the value of attribute question_id.
5 6 7 |
# File 'lib/zhSieve/htmlpage.rb', line 5 def question_id @question_id end |
Instance Method Details
#answerMarkdown ⇒ Object
18 19 20 |
# File 'lib/zhSieve/htmlpage.rb', line 18 def answerMarkdown @markdown = answer_to_markdown(@contents,@question_id,@answer_id) end |
#articleMarkdown ⇒ Object
22 23 24 |
# File 'lib/zhSieve/htmlpage.rb', line 22 def articleMarkdown @markdown = article_to_markdown(@contents,@article_id) end |
#markdown ⇒ Object
30 31 32 |
# File 'lib/zhSieve/htmlpage.rb', line 30 def markdown @markdown ||= markdown! end |
#markdown! ⇒ Object
34 35 36 |
# File 'lib/zhSieve/htmlpage.rb', line 34 def markdown! @markdown = to_markdown(@contents) end |
#peopleMarkdown ⇒ Object
14 15 16 |
# File 'lib/zhSieve/htmlpage.rb', line 14 def peopleMarkdown @markdown = people_to_markdown(@contents) end |
#to_html ⇒ Object
26 27 28 |
# File 'lib/zhSieve/htmlpage.rb', line 26 def to_html @html = @contents end |