Class: Philiprehberger::HtmlBuilder::RawNode
- Inherits:
-
Object
- Object
- Philiprehberger::HtmlBuilder::RawNode
- Defined in:
- lib/philiprehberger/html_builder/builder.rb
Overview
A node that renders raw HTML without escaping
Instance Method Summary collapse
-
#initialize(html) ⇒ RawNode
constructor
A new instance of RawNode.
-
#to_html(indent: nil, indent_size: 2) ⇒ String
The raw HTML.
Constructor Details
#initialize(html) ⇒ RawNode
Returns a new instance of RawNode.
296 297 298 |
# File 'lib/philiprehberger/html_builder/builder.rb', line 296 def initialize(html) @html = html end |
Instance Method Details
#to_html(indent: nil, indent_size: 2) ⇒ String
Returns the raw HTML.
301 302 303 304 305 306 307 |
# File 'lib/philiprehberger/html_builder/builder.rb', line 301 def to_html(indent: nil, indent_size: 2) if indent "#{' ' * (indent * indent_size)}#{@html}" else @html end end |