class HOM::Element

Attributes

attributes[R]
content[R]
tag_name[R]

Public Class Methods

new(tag_name, attributes = nil, content = Undefined) click to toggle source
# File lib/hom.rb, line 37
def initialize(tag_name, attributes = nil, content = Undefined)
  @tag_name, @attributes, @content = tag_name, AttributeList.new.update(attributes), content
end

Public Instance Methods

+(object) click to toggle source
# File lib/hom.rb, line 53
def +(object)
  NodeList.new([self, object])
end
content?() click to toggle source
# File lib/hom.rb, line 41
def content?
  @content != Undefined
end
html_safe?() click to toggle source
# File lib/hom.rb, line 45
def html_safe?
  true
end
to_s() click to toggle source
# File lib/hom.rb, line 49
def to_s
  Encoding.safe_encode(self)
end