Class: Elisp::Code

Inherits:
Object
  • Object
show all
Defined in:
lib/elisp.rb

Instance Method Summary collapse

Constructor Details

#initialize(content) ⇒ Code

Returns a new instance of Code.



82
83
84
# File 'lib/elisp.rb', line 82

def initialize(content)
  @content = content
end

Instance Method Details

#<<(content) ⇒ Object



86
87
88
# File 'lib/elisp.rb', line 86

def <<(content)
  @content << "\n#{content}"
end

#htmlObject



90
91
92
93
# File 'lib/elisp.rb', line 90

def html
  content = CGI.escape_html(@content)
  %(<pre class="code"><code>#{content}</code></pre>)
end