Class: Ravensat::InitialNode

Inherits:
Node
  • Object
show all
Defined in:
lib/ravensat/ast/initial_node.rb

Instance Attribute Summary

Attributes inherited from Node

#children

Instance Method Summary collapse

Methods inherited from Node

#clauses_size, #cnf?, #each, #each_by_descriptive, #eval, #initialize, #to_dimacs, #to_s, #vars, #vars_size

Constructor Details

This class inherits a constructor from Ravensat::Node

Instance Method Details

#&(object) ⇒ Object

Raises:

  • (TypeError)


3
4
5
6
7
8
# File 'lib/ravensat/ast/initial_node.rb', line 3

def &(object)
  raise TypeError.new("#{object.class} can't be coerced into Ravensat::Node") unless object.is_a? Node
  return self if object.is_a? NilNode

  object
end

#|(object) ⇒ Object

Raises:

  • (TypeError)


10
11
12
13
14
15
# File 'lib/ravensat/ast/initial_node.rb', line 10

def |(object)
  raise TypeError.new("#{object.class} can't be coerced into Ravensat::Node") unless object.is_a? Node
  return self if object.is_a? NilNode

  object
end