Class: EZML::Compiler
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
- #call(node) ⇒ Object
- #compile(node) ⇒ Object
-
#initialize(options) ⇒ Compiler
constructor
A new instance of Compiler.
Methods included from Util
#balance, #check_encoding, #check_ezml_encoding, #contains_interpolation?, #handle_interpolation, #html_safe, #human_indentation, #inspect_obj, #silence_warnings, #unescape_interpolation
Constructor Details
#initialize(options) ⇒ Compiler
Returns a new instance of Compiler.
12 13 14 15 16 17 18 19 |
# File 'lib/ezml/compiler.rb', line 12 def initialize() @options = Options.wrap() @to_merge = [] @temple = [:multi] @node = nil @filters = Filters.defined.merge([:filters]) @attribute_compiler = AttributeCompiler.new(@options) end |
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
10 11 12 |
# File 'lib/ezml/compiler.rb', line 10 def @options end |
Instance Method Details
#call(node) ⇒ Object
21 22 23 24 |
# File 'lib/ezml/compiler.rb', line 21 def call(node) compile(node) @temple end |
#compile(node) ⇒ Object
26 27 28 29 30 31 32 33 34 35 |
# File 'lib/ezml/compiler.rb', line 26 def compile(node) parent, @node = @node, node if node.children.empty? send(:"compile_#{node.type}") else send(:"compile_#{node.type}") {node.children.each {|c| compile c}} end ensure @node = parent end |