class HTMLNode

Public Class Methods

new(tag_name, inner, attributes = {}) click to toggle source
# File lib/textile/nodes.rb, line 36
def initialize(tag_name, inner, attributes = {})
  @tag_name = tag_name
  @inner = inner
  @attributes = attributes || {}
end

Public Instance Methods

build() click to toggle source
# File lib/textile/nodes.rb, line 42
def build
  output = []
  output << '<'
  output << @tag_name
  @attributes.each do |name, value|
    output << ' '
    output << name
    output << '="'
    output << CGI.escapeHTML(value)
    output << '"'
  end
  output << '>'
  output << @inner.build
  output << '</'
  output << @tag_name
  output << '>'
  output.join('')
end