Class: Circuits::Component::Not
- Defined in:
- lib/circuits/component/not.rb
Overview
Logical NOT Operator
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize ⇒ Not
constructor
A new instance of Not.
-
#tick ⇒ Object
Sets the output to be the result of a logical NOT of the inputs.
Methods inherited from Base
Constructor Details
#initialize ⇒ Not
Returns a new instance of Not.
7 8 9 |
# File 'lib/circuits/component/not.rb', line 7 def initialize super(inputs: 1, outputs: 1) end |
Instance Method Details
#tick ⇒ Object
Sets the output to be the result of a logical NOT of the inputs
12 13 14 |
# File 'lib/circuits/component/not.rb', line 12 def tick out.set(!self[:in].get) end |