class Arbre::HTML::TextNode

Public Class Methods

from_string(string) click to toggle source

Builds a text node from a string

# File lib/arbre/html/text_node.rb, line 11
def self.from_string(string)
  node = new
  node.build(string)
  node
end

Public Instance Methods

add_child(*args) click to toggle source
# File lib/arbre/html/text_node.rb, line 17
def add_child(*args)
  raise "TextNodes do not have children"
end
build(string) click to toggle source
# File lib/arbre/html/text_node.rb, line 21
def build(string)
  @content = string
end
class_list() click to toggle source
# File lib/arbre/html/text_node.rb, line 25
def class_list
  []
end
tag_name() click to toggle source
# File lib/arbre/html/text_node.rb, line 29
def tag_name
  nil
end
to_s() click to toggle source
# File lib/arbre/html/text_node.rb, line 33
def to_s
  ERB::Util.html_escape(@content.to_s)
end