Class: GhostWheel::Expression::Rule
- Inherits:
-
GhostWheel::Expression
- Object
- GhostWheel::Expression
- GhostWheel::Expression::Rule
- Defined in:
- lib/ghost_wheel/expression/rule.rb
Instance Attribute Summary collapse
-
#expression ⇒ Object
Returns the value of attribute expression.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(expression = nil) ⇒ Rule
constructor
A new instance of Rule.
- #uncached_parse(scanner, cache) ⇒ Object
Methods inherited from GhostWheel::Expression
Constructor Details
#initialize(expression = nil) ⇒ Rule
Returns a new instance of Rule.
6 7 8 |
# File 'lib/ghost_wheel/expression/rule.rb', line 6 def initialize(expression = nil) @expression = expression end |
Instance Attribute Details
#expression ⇒ Object
Returns the value of attribute expression.
10 11 12 |
# File 'lib/ghost_wheel/expression/rule.rb', line 10 def expression @expression end |
Instance Method Details
#==(other) ⇒ Object
19 20 21 |
# File 'lib/ghost_wheel/expression/rule.rb', line 19 def ==(other) super and @expression == other.expression end |
#uncached_parse(scanner, cache) ⇒ Object
12 13 14 15 16 17 |
# File 'lib/ghost_wheel/expression/rule.rb', line 12 def uncached_parse(scanner, cache) if @expression.nil? raise EmptyRuleError, "You failed to set an expression for this rule." end @expression.parse(scanner, cache) end |