module Rhtml

Constants

INDENT
TAGS
VERSION
VOID_TAGS

Public Class Methods

properties(ps) click to toggle source
# File lib/rhtml/tag.rb, line 16
def Rhtml.properties ps
  ps.map { |p| "#{p[0].to_s.gsub("_", "-")}='#{p[1].to_s}'" }.join(' ')
end
tag_close(tag_name, indent) click to toggle source
# File lib/rhtml/tag.rb, line 28
def Rhtml.tag_close tag_name, indent
  "#{INDENT * indent}</#{tag_name}>\n"
end
tag_open(tag_name, ps={}) click to toggle source
# File lib/rhtml/tag.rb, line 24
def Rhtml.tag_open tag_name, ps={}, indent
  "#{INDENT * indent}<#{tag_name}#{' ' << properties(ps) unless ps.empty?}>\n"
end
void_tag(tag_name, ps={}) click to toggle source
# File lib/rhtml/tag.rb, line 20
def Rhtml.void_tag tag_name, ps={}, indent
  "#{INDENT * indent}<#{tag_name}#{' ' << properties(ps) unless ps.empty?}/>\n"
end

Public Instance Methods

html!(&b) click to toggle source
# File lib/rhtml/shortcut.rb, line 2
def html!(&b)
  Rhtml::Html.new.html(&b)
end