Module: Negation

Includes:
Decision
Defined in:
lib/logic_operations.rb

Instance Method Summary collapse

Methods included from Decision

#mcdc_pairs, #test_cases, #truth_table

Instance Method Details

#condition_identifiersObject



64
65
66
# File 'lib/logic_operations.rb', line 64

def condition_identifiers
  operand.condition_identifiers
end

#evaluate(conditions) ⇒ Object



68
69
70
# File 'lib/logic_operations.rb', line 68

def evaluate(conditions)
  negate(operand.evaluate(conditions))
end

#negate(value) ⇒ Object



72
73
74
# File 'lib/logic_operations.rb', line 72

def negate(value)
  1 ^ value
end