Class: Facwparser::Element::CodeMacro

Inherits:
MacroBase show all
Defined in:
lib/facwparser/element.rb

Instance Attribute Summary

Attributes inherited from ElementBase

#children, #source

Instance Method Summary collapse

Methods inherited from ElementBase

#==, #render_text

Constructor Details

#initialize(source, options, value) ⇒ CodeMacro

Returns a new instance of CodeMacro.



204
205
206
207
208
# File 'lib/facwparser/element.rb', line 204

def initialize(source, options, value)
  super(source)
  @options = options
  @value = value
end

Instance Method Details

#render_html(options) ⇒ Object



209
210
211
212
# File 'lib/facwparser/element.rb', line 209

def render_html(options)
  "<pre class=\"#{CGI.escapeHTML(@options[1..-1])}\">" +
    render_html_by_name_and_value('code', @value) + "</pre>" + "\n"
end