class Glyph::ParameterNode

A Glyph macro parameter in Glyph Abstract Syntax Tree @since 0.3.0

Public Instance Methods

contents() click to toggle source

@return [String] a textual representation of the parameter contents @since 0.3.0

# File lib/glyph/syntax_node.rb, line 189
def contents
        parent[:escape] ? ".[=#{children.join}=]" : children.join
end
evaluate(context, options={:params => false}) click to toggle source

@param [Glyph::MacroNode] context the context of the macro @param [Hash] options a hash of options @option options [Boolean] :params whether to evaluate child nodes or not @return [String] the evaluated child nodes @since 0.3.0

# 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
to_s() click to toggle source

@return [String] a textual representation of the parameter node @since 0.3.0

# File lib/glyph/syntax_node.rb, line 183
def to_s
        children.join
end