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.
306 307 308 |
# File 'lib/philiprehberger/html_builder/builder.rb', line 306 def initialize(html) @html = html end |
Instance Method Details
#to_html(indent: nil, indent_size: 2) ⇒ String
Returns the raw HTML.
311 312 313 314 315 316 317 |
# File 'lib/philiprehberger/html_builder/builder.rb', line 311 def to_html(indent: nil, indent_size: 2) if indent "#{' ' * (indent * indent_size)}#{@html}" else @html end end |