Class: Propose::Tree::Conjunction

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

Overview

A conjunction of two expressions, indicating both are 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) ⇒ Conjunction

Returns a new instance of Conjunction.



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

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

Instance Method Details

#evaluate(assignment) ⇒ Object



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

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