Class: AutoPilot::HtmlConverter

Inherits:
Object
  • Object
show all
Includes:
TemplateHelper
Defined in:
lib/auto_pilot/html_converter.rb

Constant Summary collapse

DEFAULT_BLOG_FOLDER =
'./blog'

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from TemplateHelper

#file_name, #make_folder_if_doesnt_exist, #parameterize, #write_file_to_disk

Constructor Details

#initialize(doc) ⇒ HtmlConverter

Returns a new instance of HtmlConverter.



9
10
11
12
13
14
15
# File 'lib/auto_pilot/html_converter.rb', line 9

def initialize(doc)
  @h1_tag       = doc.title_html
  @question = doc.question_html
  @answer   = doc.answer_html
  make_folder_if_doesnt_exist
  write_file_to_disk(AutoPilot.configuration.folder, :html)
end

Instance Attribute Details

#answerObject (readonly)

Returns the value of attribute answer.



5
6
7
# File 'lib/auto_pilot/html_converter.rb', line 5

def answer
  @answer
end

#docObject (readonly)

Returns the value of attribute doc.



5
6
7
# File 'lib/auto_pilot/html_converter.rb', line 5

def doc
  @doc
end

#h1_tagObject (readonly)

Returns the value of attribute h1_tag.



5
6
7
# File 'lib/auto_pilot/html_converter.rb', line 5

def h1_tag
  @h1_tag
end

#questionObject (readonly)

Returns the value of attribute question.



5
6
7
# File 'lib/auto_pilot/html_converter.rb', line 5

def question
  @question
end