Class: Circuits::Terminal::Input
- Inherits:
-
Object
- Object
- Circuits::Terminal::Input
- Defined in:
- lib/circuits/terminal/input.rb
Overview
Reads from a single output, only assigned to one component
Instance Attribute Summary collapse
-
#output ⇒ Object
Returns the value of attribute output.
Instance Method Summary collapse
-
#get ⇒ TrueClass, FalseClass
Forward get to the output.
-
#initialize(opts = {}) ⇒ Input
constructor
Creates the input.
-
#set(s) ⇒ Object
Create a new output to use.
Constructor Details
#initialize(opts = {}) ⇒ Input
Creates the input
10 11 12 |
# File 'lib/circuits/terminal/input.rb', line 10 def initialize(opts = {}) @output = opts[:output] || Circuits::Terminal::Output.new end |
Instance Attribute Details
#output ⇒ Object
Returns the value of attribute output.
14 15 16 |
# File 'lib/circuits/terminal/input.rb', line 14 def output @output end |
Instance Method Details
#get ⇒ TrueClass, FalseClass
Forward get to the output
18 19 20 |
# File 'lib/circuits/terminal/input.rb', line 18 def get output.get end |
#set(s) ⇒ Object
Create a new output to use
24 25 26 |
# File 'lib/circuits/terminal/input.rb', line 24 def set(s) @output = Circuits::Terminal::Output.new(state: s) end |