Module: Mumukit::ContentType::Plain

Extended by:
BaseContentType
Defined in:
lib/mumukit/content_type/plain.rb

Class Method Summary collapse

Methods included from BaseContentType

as_json, format_exception, to_html, to_s

Class Method Details

.code(code) ⇒ Object



8
9
10
# File 'lib/mumukit/content_type/plain.rb', line 8

def self.code(code)
  "\n-----\n#{code}\n-----\n\n"
end

.enumerate(items) ⇒ Object



20
21
22
# File 'lib/mumukit/content_type/plain.rb', line 20

def self.enumerate(items)
  items.join("\n")
end

.nameObject



16
17
18
# File 'lib/mumukit/content_type/plain.rb', line 16

def self.name
  'plain'
end

.title(title) ⇒ Object



4
5
6
# File 'lib/mumukit/content_type/plain.rb', line 4

def self.title(title)
  "#{title}:"
end

.to_html(content) ⇒ Object



12
13
14
# File 'lib/mumukit/content_type/plain.rb', line 12

def self.to_html(content)
  "<pre>#{ERB::Util.html_escape content}</pre>".html_safe
end