Class: Claus::AST::List
Overview
Hash
Instance Attribute Summary
Attributes inherited from Node
Instance Method Summary collapse
Methods inherited from Node
Constructor Details
This class inherits a constructor from Claus::AST::Node
Instance Method Details
#compile(expression) ⇒ Object
78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/claus.rb', line 78 def compile expression expression.map do |v| case v when ::Hash then Hash.new(v) when ::Array then List.new(v) when ::Range then List.new(v) when Claus then v.ast else v.kind_of?(Node) ? v : Node.new(v) end end end |
#match?(value) ⇒ Boolean
90 91 92 |
# File 'lib/claus.rb', line 90 def match? value !!ast.find {|node| node.match?(value)} end |