Class: Protocol

Inherits:
PersistentDocument show all
Defined in:
lib/almirah/doc_types/protocol.rb

Instance Attribute Summary collapse

Attributes inherited from PersistentDocument

#controlled_items, #frontmatter, #headings, #items, #path, #up_link_docs

Attributes inherited from BaseDocument

#dom, #headings, #id, #output_rel_path, #title

Instance Method Summary collapse

Methods inherited from BaseDocument

#critical_chain_link, #decisions_link, #home_link, #index_link, #needs_chartjs?, #rel_to, #save_html_to_file

Constructor Details

#initialize(fele_path) ⇒ Protocol

Returns a new instance of Protocol.



6
7
8
9
10
# File 'lib/almirah/doc_types/protocol.rb', line 6

def initialize(fele_path)
  super
  @id = File.basename(fele_path, File.extname(fele_path)).downcase
  @specifications_path = './../../../specifications/'
end

Instance Attribute Details

#specifications_pathObject

Returns the value of attribute specifications_path.



4
5
6
# File 'lib/almirah/doc_types/protocol.rb', line 4

def specifications_path
  @specifications_path
end

Instance Method Details

#to_html(nav_pane, output_file_path) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/almirah/doc_types/protocol.rb', line 12

def to_html(nav_pane, output_file_path)
  html_rows = []

  html_rows.append('')

  @items.each do |item|
    a = item.to_html
    html_rows.append a
  end

  save_html_to_file(html_rows, nav_pane, output_file_path)
end