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.



127
128
129
# File 'lib/elisp.rb', line 127

def initialize(content)
  @content = content
end

Instance Method Details

#<<(content) ⇒ Object



131
132
133
# File 'lib/elisp.rb', line 131

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

#htmlObject



135
136
137
138
# File 'lib/elisp.rb', line 135

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