Class: Claus::AST::Node
- Inherits:
-
Object
- Object
- Claus::AST::Node
- Defined in:
- lib/claus.rb
Instance Attribute Summary collapse
-
#ast ⇒ Object
readonly
Returns the value of attribute ast.
Instance Method Summary collapse
- #compile(expression) ⇒ Object
-
#initialize(expression) ⇒ Node
constructor
A new instance of Node.
- #match?(value) ⇒ Boolean
Constructor Details
#initialize(expression) ⇒ Node
Returns a new instance of Node.
41 42 43 |
# File 'lib/claus.rb', line 41 def initialize expression @ast = compile(expression) end |
Instance Attribute Details
#ast ⇒ Object (readonly)
Returns the value of attribute ast.
40 41 42 |
# File 'lib/claus.rb', line 40 def ast @ast end |
Instance Method Details
#compile(expression) ⇒ Object
45 46 47 |
# File 'lib/claus.rb', line 45 def compile expression expression end |
#match?(value) ⇒ Boolean
49 50 51 |
# File 'lib/claus.rb', line 49 def match? value ast == '*' || ast == value end |