Class: Keisan::AST::Null

Inherits:
ConstantLiteral show all
Defined in:
lib/keisan/ast/null.rb

Instance Method Summary collapse

Methods inherited from ConstantLiteral

#==, #evaluate, #to_s

Methods inherited from Node

#!, #%, #&, #*, #**, #+, #+@, #-, #-@, #/, #<, #<=, #>, #>=, #^, #and, #coerce, #deep_dup, #differentiate, #evaluate, #evaluate_assignments, #evaluated, #false?, #or, #replace, #simplified, #simplify, #to_cell, #to_node, #unbound_functions, #unbound_variables, #well_defined?, #|, #~

Constructor Details

#initializeNull

Returns a new instance of Null.



4
5
# File 'lib/keisan/ast/null.rb', line 4

def initialize
end

Instance Method Details

#equal(other) ⇒ Object



15
16
17
18
# File 'lib/keisan/ast/null.rb', line 15

def equal(other)
  other = other.to_node
  other.is_a?(AST::Null) ? Boolean.new(value == other.value) : super
end

#not_equal(other) ⇒ Object



20
21
22
23
# File 'lib/keisan/ast/null.rb', line 20

def not_equal(other)
  other = other.to_node
  other.is_a?(AST::Null) ? Boolean.new(value != other.value) : super
end

#true?Boolean

Returns:



11
12
13
# File 'lib/keisan/ast/null.rb', line 11

def true?
  false
end

#value(context = nil) ⇒ Object



7
8
9
# File 'lib/keisan/ast/null.rb', line 7

def value(context = nil)
  nil
end