Class: Lotus::Helpers::HtmlHelper::HtmlFragment Private
- Inherits:
-
Object
- Object
- Lotus::Helpers::HtmlHelper::HtmlFragment
- Defined in:
- lib/lotus/helpers/html_helper/html_fragment.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
HTML Fragment
Instance Method Summary collapse
- #content ⇒ Object private
-
#initialize(&blk) ⇒ Lotus::Helpers::HtmlHelper::HtmlFragment
constructor
private
Initialize a HTML Fragment.
-
#to_s ⇒ String
private
Resolve and return the output.
Constructor Details
#initialize(&blk) ⇒ Lotus::Helpers::HtmlHelper::HtmlFragment
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Initialize a HTML Fragment
16 17 18 19 |
# File 'lib/lotus/helpers/html_helper/html_fragment.rb', line 16 def initialize(&blk) @builder = HtmlBuilder.new @blk = blk end |
Instance Method Details
#content ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
33 34 35 36 37 38 39 40 41 |
# File 'lib/lotus/helpers/html_helper/html_fragment.rb', line 33 def content result = @builder.resolve(&@blk) if @builder.nested? @builder.to_s else "#{ Utils::Escape.html(result) }" end end |
#to_s ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Resolve and return the output
29 30 31 |
# File 'lib/lotus/helpers/html_helper/html_fragment.rb', line 29 def to_s content.to_s end |