Class: Propose::Tree::Disjunction

Inherits:
BinaryOperation show all
Defined in:
lib/propose/tree/disjunction.rb

Overview

A disjunction of two expressions, indicating at least one of them is true.

Instance Attribute Summary

Attributes inherited from BinaryOperation

#left, #operator, #right

Instance Method Summary collapse

Methods inherited from BinaryOperation

#==, #children, #inspect, #to_s

Methods inherited from Node

#children, #literal?

Constructor Details

#initialize(left, right) ⇒ Disjunction

Returns a new instance of Disjunction.



4
5
6
# File 'lib/propose/tree/disjunction.rb', line 4

def initialize(left, right)
  super('', left, right)
end

Instance Method Details

#evaluate(assignment) ⇒ Object



8
9
10
# File 'lib/propose/tree/disjunction.rb', line 8

def evaluate(assignment)
  left.evaluate(assignment) || right.evaluate(assignment)
end