class Organismo::Element::Code
Attributes
content[R]
location[R]
Public Class Methods
new(text, location)
click to toggle source
# File lib/organismo/element/code.rb, line 5 def initialize(text, location) @content = text_without_wrapper(text) @location = location end
Public Instance Methods
convert_to_html()
click to toggle source
# File lib/organismo/element/code.rb, line 10 def convert_to_html "<div class=\"code\"><pre>#{content}</pre></div>" end
Private Instance Methods
text_without_wrapper(text)
click to toggle source
# File lib/organismo/element/code.rb, line 16 def text_without_wrapper(text) CGI.escapeHTML(text.split("\n")[1..-2].join("\n")) end