Sha256: 2c69421347c9a9254a5dee02df4feb0e8f15c32f25f6e189eea7192314b53fec

Contents?: true

Size: 524 Bytes

Versions: 4

Compression:

Stored size: 524 Bytes

Contents

module Hardware
  class Display < Component
    
    def initialize(actuator_collection) 
      super(nil, actuator_collection)
      @lines = ['','']
    end

    def line_one
      @lines[0]
    end
    
    def line_two
      @lines[1]
    end

    def show(line, message)
      return unless line.is_a?(Fixnum) && line >= 0
      @lines[line] = message[0,16]
      changed
    end

    def configure
      create_actuator_for(:display_show) do |line, message|
        show(line, message)
      end
    end    
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
vmsim-1.0.1 lib/hardware/display.rb
vmsim-1.0.0 lib/hardware/display.rb
vmsim-0.2.4 lib/hardware/display.rb
vmsim-0.2.3 lib/hardware/display.rb