Class: RulerCoaster::Logic::Nor

Inherits:
Base
  • Object
show all
Defined in:
lib/ruler_coaster/logic/nor.rb

Instance Attribute Summary

Attributes inherited from Base

#left, #right

Instance Method Summary collapse

Methods inherited from Base

#initialize

Methods included from Mixin

#and, #nor, #not, #or

Constructor Details

This class inherits a constructor from RulerCoaster::Logic::Base

Instance Method Details

#call(object) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'lib/ruler_coaster/logic/nor.rb', line 4

def call(object)
  result = left.call(object)

  if !result.success?
    right.call(object).negation
  else
    result.negation
  end
end