Sha256: d049dc1c4f883e18e089715b008b9346658b9fc56b21315e0f8f485da92a9449
Contents?: true
Size: 529 Bytes
Versions: 12
Compression:
Stored size: 529 Bytes
Contents
require 'erb' module Arbre module HTML class TextNode < Element builder_method :text_node # Builds a text node from a string def self.from_string(string) node = new node.build(string) node end def add_child(*args) raise "TextNodes do not have children" end def build(string) @content = string end def tag_name nil end def to_s ERB::Util.html_escape(@content.to_s) end end end end
Version data entries
12 entries across 12 versions & 3 rubygems