Class: TodoBlock

Inherits:
DocItem show all
Defined in:
lib/almirah/doc_items/todo_block.rb

Instance Attribute Summary collapse

Attributes inherited from DocItem

#parent_doc, #parent_heading

Instance Method Summary collapse

Methods inherited from DocItem

#get_url

Methods inherited from TextLine

add_lazy_doc_id, #bold, #bold_and_italic, #format_string, #italic, #link

Methods inherited from TextLineBuilderContext

#bold, #bold_and_italic, #italic, #link

Constructor Details

#initialize(text) ⇒ TodoBlock

Returns a new instance of TodoBlock.



7
8
9
# File 'lib/almirah/doc_items/todo_block.rb', line 7

def initialize(text)
    @text = text
end

Instance Attribute Details

#textObject

Returns the value of attribute text.



5
6
7
# File 'lib/almirah/doc_items/todo_block.rb', line 5

def text
  @text
end

Instance Method Details

#to_htmlObject



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/almirah/doc_items/todo_block.rb', line 11

def to_html
    s = ''
    f_text = format_string(@text)
    if @@html_table_render_in_progress
        s += "</table>\n"
        @@html_table_render_in_progress = false
    end

    s += "<div class=\"todoblock\"><p>#{f_text}</div>\n"
    return s
end