Class: DrgDSL::Ast::NotExpression
- Inherits:
-
Object
- Object
- DrgDSL::Ast::NotExpression
- Includes:
- Node
- Defined in:
- lib/drgdsl/ast.rb
Overview
A NotExpression is a logic text of the form
"not (expression)"
Instance Attribute Summary collapse
-
#expression ⇒ Object
readonly
Returns the value of attribute expression.
Instance Method Summary collapse
- #hash ⇒ Object
-
#initialize(expression) ⇒ NotExpression
constructor
A new instance of NotExpression.
- #to_hash ⇒ Object
Methods included from Node
#==, #accept, included, #mdc_equality?, node_classes, #pretty_print, #sep_equality?, type, #type
Constructor Details
#initialize(expression) ⇒ NotExpression
Returns a new instance of NotExpression.
153 154 155 |
# File 'lib/drgdsl/ast.rb', line 153 def initialize(expression) @expression = expression end |
Instance Attribute Details
#expression ⇒ Object (readonly)
Returns the value of attribute expression.
151 152 153 |
# File 'lib/drgdsl/ast.rb', line 151 def expression @expression end |
Instance Method Details
#hash ⇒ Object
161 162 163 |
# File 'lib/drgdsl/ast.rb', line 161 def hash @hash ||= [type, expression].hash end |
#to_hash ⇒ Object
157 158 159 |
# File 'lib/drgdsl/ast.rb', line 157 def to_hash { not: expression.to_hash } end |