Method: Glyph::ParameterNode#evaluate

Defined in:
lib/glyph/syntax_node.rb

#evaluate(context, options = {:params => false}) ⇒ String

Returns the evaluated child nodes.

Parameters:

  • context (Glyph::MacroNode)

    the context of the macro

  • options (Hash) (defaults to: {:params => false})

    a hash of options

Options Hash (options):

  • :params (Boolean)

    whether to evaluate child nodes or not

Returns:

  • (String)

    the evaluated child nodes

Since:

  • 0.3.0



198
199
200
201
202
# File 'lib/glyph/syntax_node.rb', line 198

def evaluate(context, options={:params => false})
  self[:value] = ""
  self.children.each {|c| self[:value] << c.evaluate(context) } if options[:params]
  self[:value]
end