class Hanami::Helpers::HtmlHelper::TextNode

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

@since 0.2.5 @api private

Public Class Methods

new(content) click to toggle source

Initialize a new text node

@param content [String,#to_s] The content to be added.

@return [Hanami::Helpers::HtmlHelper::TextNode]

@since 0.2.5 @api private

# File lib/hanami/helpers/html_helper/text_node.rb, line 19
def initialize(content)
  @content = content.to_s
end

Public Instance Methods

to_s() click to toggle source

Resolve and return the output

@return [String] the output

@since 0.2.5 @api private

# File lib/hanami/helpers/html_helper/text_node.rb, line 29
def to_s
  Utils::Escape.html(@content)
end