Class: AutoPilot::MarkdownConverter
- Inherits:
-
Object
- Object
- AutoPilot::MarkdownConverter
- Includes:
- TemplateHelper
- Defined in:
- lib/auto_pilot/markdown_converter.rb
Constant Summary collapse
- DEFAULT_BLOG_FOLDER =
'./stackoverflow'
Instance Attribute Summary collapse
-
#answer ⇒ Object
readonly
Returns the value of attribute answer.
-
#doc ⇒ Object
readonly
Returns the value of attribute doc.
-
#h1_tag ⇒ Object
readonly
Returns the value of attribute h1_tag.
-
#question ⇒ Object
readonly
Returns the value of attribute question.
Instance Method Summary collapse
-
#initialize(doc) ⇒ MarkdownConverter
constructor
A new instance of MarkdownConverter.
Methods included from TemplateHelper
#file_name, #make_folder_if_doesnt_exist, #parameterize, #write_file_to_disk
Constructor Details
#initialize(doc) ⇒ MarkdownConverter
Returns a new instance of MarkdownConverter.
11 12 13 14 15 16 17 |
# File 'lib/auto_pilot/markdown_converter.rb', line 11 def initialize(doc) @h1_tag = to_markdown doc.title_html @question = to_markdown doc.question_html @answer = to_markdown doc.answer_html make_folder_if_doesnt_exist write_file_to_disk(AutoPilot.configuration.folder, :md) end |
Instance Attribute Details
#answer ⇒ Object (readonly)
Returns the value of attribute answer.
7 8 9 |
# File 'lib/auto_pilot/markdown_converter.rb', line 7 def answer @answer end |
#doc ⇒ Object (readonly)
Returns the value of attribute doc.
7 8 9 |
# File 'lib/auto_pilot/markdown_converter.rb', line 7 def doc @doc end |
#h1_tag ⇒ Object (readonly)
Returns the value of attribute h1_tag.
7 8 9 |
# File 'lib/auto_pilot/markdown_converter.rb', line 7 def h1_tag @h1_tag end |
#question ⇒ Object (readonly)
Returns the value of attribute question.
7 8 9 |
# File 'lib/auto_pilot/markdown_converter.rb', line 7 def question @question end |