Module: Mumukit::ContentType::BaseContentType
Instance Method Summary collapse
- #as_json(_options = {}) ⇒ Object
- #format_exception(e) ⇒ Object
- #to_html(content) ⇒ Object
- #to_s ⇒ Object
Instance Method Details
#as_json(_options = {}) ⇒ Object
19 20 21 |
# File 'lib/mumukit/content_type.rb', line 19 def as_json(={}) name end |
#format_exception(e) ⇒ Object
7 8 9 |
# File 'lib/mumukit/content_type.rb', line 7 def format_exception(e) "#{title e.}\n#{code e.backtrace.join("\n")}" end |
#to_html(content) ⇒ Object
11 12 13 |
# File 'lib/mumukit/content_type.rb', line 11 def to_html(content) Mumukit::ContentType::Sanitizer.sanitize(htmlize content)&.html_safe end |
#to_s ⇒ Object
15 16 17 |
# File 'lib/mumukit/content_type.rb', line 15 def to_s name end |