Class: TestStepReferenceColumn

Inherits:
ControlledTableColumn show all
Defined in:
lib/almirah/doc_items/controlled_table.rb

Instance Attribute Summary collapse

Attributes inherited from ControlledTableColumn

#text

Instance Method Summary collapse

Methods inherited from TextLine

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

Constructor Details

#initialize(text) ⇒ TestStepReferenceColumn

Returns a new instance of TestStepReferenceColumn.



62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/almirah/doc_items/controlled_table.rb', line 62

def initialize(text)
    
    @up_link = nil
    @up_link_doc_id = nil

    if tmp = />\[(\S*)\]/.match(text)   # >[SRS-001]

        @up_link = tmp[1]
        if tmp = /^([a-zA-Z]+)[-]\d+/.match(@up_link)   # SRS

            @up_link_doc_id = tmp[1].downcase 
        end
    end
end

Instance Attribute Details

Returns the value of attribute up_link.



59
60
61
# File 'lib/almirah/doc_items/controlled_table.rb', line 59

def up_link
  @up_link
end

Returns the value of attribute up_link_doc_id.



60
61
62
# File 'lib/almirah/doc_items/controlled_table.rb', line 60

def up_link_doc_id
  @up_link_doc_id
end

Instance Method Details

#to_htmlObject



75
76
77
78
79
80
81
# File 'lib/almirah/doc_items/controlled_table.rb', line 75

def to_html
    if @up_link
        "\t\t<td class=\"item_id\"><a href=\"./../../../specifications/#{@up_link_doc_id}/#{@up_link_doc_id}.html##{@up_link}\" class=\"external\">#{@up_link}</a></td>\n\r"
    else
        "\t\t<td style=\"text-align: center;\"></td>\n\r"
    end
end