Class: Circuits::Component::Not

Inherits:
Base
  • Object
show all
Defined in:
lib/circuits/component/not.rb

Overview

Logical NOT Operator

Instance Attribute Summary

Attributes inherited from Base

#inputs, #outputs

Instance Method Summary collapse

Methods inherited from Base

#[], #initialize, #tock

Constructor Details

This class inherits a constructor from Circuits::Component::Base

Instance Method Details

#tickObject

Sets the output to be the result of a logical NOT of the inputs



8
9
10
# File 'lib/circuits/component/not.rb', line 8

def tick
  self[:out].set(!self[:in].get)
end