Class: Circuits::Component::And

Inherits:
Object
  • Object
show all
Includes:
Circuits::Component
Defined in:
lib/circuits/component/and.rb

Overview

Logical AND Operator

Instance Attribute Summary

Attributes included from Circuits::Component

#inputs, #outputs

Instance Method Summary collapse

Methods included from Circuits::Component

#[], #[]=, #initialize, #tock

Instance Method Details

#tickObject

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



10
11
12
# File 'lib/circuits/component/and.rb', line 10

def tick
  outputs[0].set(inputs.map(&:get).inject(:&))
end