Module: Asuka::HTMLable
Instance Method Summary collapse
- #==(other) ⇒ Object
- #to_html ⇒ Object
- #wrap(tag, content, indent = false) ⇒ Object
- #wrap_indent(tag, content) ⇒ Object
Instance Method Details
#==(other) ⇒ Object
15 16 17 |
# File 'lib/asuka/document.rb', line 15 def ==(other) to_html == other.to_html end |
#to_html ⇒ Object
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 |