Class: Hardware::Display
Instance Method Summary collapse
- #configure ⇒ Object
-
#initialize(actuator_collection) ⇒ Display
constructor
A new instance of Display.
- #line_one ⇒ Object
- #line_two ⇒ Object
- #show(line, message) ⇒ Object
Methods inherited from Component
Constructor Details
#initialize(actuator_collection) ⇒ Display
Returns a new instance of Display.
4 5 6 7 |
# File 'lib/hardware/display.rb', line 4 def initialize(actuator_collection) super(nil, actuator_collection) @lines = ['',''] end |
Instance Method Details
#configure ⇒ Object
23 24 25 26 27 |
# File 'lib/hardware/display.rb', line 23 def configure create_actuator_for(:display_show) do |line, | show(line, ) end end |
#line_one ⇒ Object
9 10 11 |
# File 'lib/hardware/display.rb', line 9 def line_one @lines[0] end |
#line_two ⇒ Object
13 14 15 |
# File 'lib/hardware/display.rb', line 13 def line_two @lines[1] end |
#show(line, message) ⇒ Object
17 18 19 20 21 |
# File 'lib/hardware/display.rb', line 17 def show(line, ) return unless line.is_a?(Fixnum) && line >= 0 @lines[line] = [0,16] changed end |