Class: Circuits::Terminal::Output
- Inherits:
-
Object
- Object
- Circuits::Terminal::Output
- Defined in:
- lib/circuits/terminal/output.rb
Overview
Belongs to a single component, gets set for reading by inputs
Instance Method Summary collapse
-
#get ⇒ Boolean
Gets the state of the output.
-
#initialize(opts = {}) ⇒ Output
constructor
Creates the output.
-
#set(s) ⇒ Object
Saves the state.
-
#tock ⇒ Object
Sets the state to be the last state passed by #set.
Constructor Details
#initialize(opts = {}) ⇒ Output
Creates the output
10 11 12 13 |
# File 'lib/circuits/terminal/output.rb', line 10 def initialize(opts = {}) @next_state = opts[:state] || false @state = opts[:state] || false end |
Instance Method Details
#get ⇒ Boolean
Gets the state of the output
17 18 19 |
# File 'lib/circuits/terminal/output.rb', line 17 def get state end |
#set(s) ⇒ Object
Saves the state
23 24 25 |
# File 'lib/circuits/terminal/output.rb', line 23 def set(s) @next_state = s end |
#tock ⇒ Object
Sets the state to be the last state passed by #set
28 29 30 |
# File 'lib/circuits/terminal/output.rb', line 28 def tock @state = next_state end |