Class: NotNode

Inherits:
Node
  • Object
show all
Defined in:
lib/nodes/basenodes.rb

Instance Attribute Summary

Attributes inherited from Node

#value

Instance Method Summary collapse

Constructor Details

#initialize(node) ⇒ NotNode

Returns a new instance of NotNode.



128
129
130
# File 'lib/nodes/basenodes.rb', line 128

def initialize(node)
  @node = node
end

Instance Method Details

#evaluateObject



136
137
138
# File 'lib/nodes/basenodes.rb', line 136

def evaluate
  not @node.evaluate
end

#to_sObject



132
133
134
# File 'lib/nodes/basenodes.rb', line 132

def to_s
  "not #{@node}"
end