Module: Asuka::HTMLable

Included in:
Header, LineGroup, Rule
Defined in:
lib/asuka/document.rb

Instance Method Summary collapse

Instance Method Details

#==(other) ⇒ Object



15
16
17
# File 'lib/asuka/document.rb', line 15

def ==(other)
  to_html == other.to_html
end

#to_htmlObject

Raises:

  • (NotImplementedError)


3
4
5
# File 'lib/asuka/document.rb', line 3

def to_html
  raise NotImplementedError, "%s does not implement the #to_html method" % [self.class.name]
end

#wrap(tag, content, indent = false) ⇒ Object



7
8
9
# File 'lib/asuka/document.rb', line 7

def wrap(tag, content, indent=false)
  ["<#{tag}>", content, "</#{tag}>"].join(indent ? "\n" : "")
end

#wrap_indent(tag, content) ⇒ Object



11
12
13
# File 'lib/asuka/document.rb', line 11

def wrap_indent(tag, content)
  wrap(tag, content, true)
end