Class: Lotus::Helpers::HtmlHelper::TextNode Private

Inherits:
Object
  • Object
show all
Defined in:
lib/lotus/helpers/html_helper/text_node.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.

Text node. Allows for text to be inserted between HTML tags.

Since:

  • 0.2.5

Instance Method Summary collapse

Constructor Details

#initialize(content) ⇒ Lotus::Helpers::HtmlHelper::TextNode

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 new text node

Parameters:

  • content (String, #to_s)

    The content to be added.

Since:

  • 0.2.5



17
18
19
# File 'lib/lotus/helpers/html_helper/text_node.rb', line 17

def initialize(content)
  @content = content.to_s
end

Instance Method Details

#to_sString

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

Returns:

  • (String)

    the output

Since:

  • 0.2.5



27
28
29
# File 'lib/lotus/helpers/html_helper/text_node.rb', line 27

def to_s
  Utils::Escape.html(@content)
end