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.
276 277 278 |
# File 'lib/philiprehberger/html_builder/builder.rb', line 276 def initialize(html) @html = html end |
Instance Method Details
#to_html(indent: nil, indent_size: 2) ⇒ String
Returns the raw HTML.
281 282 283 284 285 286 287 |
# File 'lib/philiprehberger/html_builder/builder.rb', line 281 def to_html(indent: nil, indent_size: 2) if indent "#{' ' * (indent * indent_size)}#{@html}" else @html end end |