Class: Cuporter::Document::Html

Inherits:
Nokogiri::XML::Document
  • Object
show all
Defined in:
lib/cuporter/document/html_document.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#assets_base_pathObject

Returns the value of attribute assets_base_path.



5
6
7
# File 'lib/cuporter/document/html_document.rb', line 5

def assets_base_path
  @assets_base_path
end

#assets_srcObject

Returns the value of attribute assets_src.



5
6
7
# File 'lib/cuporter/document/html_document.rb', line 5

def assets_src
  @assets_src
end

Returns the value of attribute link_assets.



5
6
7
# File 'lib/cuporter/document/html_document.rb', line 5

def link_assets
  @link_assets
end

#viewObject

Returns the value of attribute view.



5
6
7
# File 'lib/cuporter/document/html_document.rb', line 5

def view
  @view
end

Instance Method Details

#add_report(node) ⇒ Object



11
12
13
14
15
16
# File 'lib/cuporter/document/html_document.rb', line 11

def add_report(node)
  root << head(node['title'])
  body = new_node('body')
  body << node
  root << body
end

#to_html(options = {}) ⇒ Object

remove CDATA tags so CSS works



19
20
21
# File 'lib/cuporter/document/html_document.rb', line 19

def to_html(options = {})
  to_xhtml(options).gsub(/(<!\[CDATA\[|\]\]>)/,'')
end