Sha256: 3b1244dfd9adac8a787b6bc53cdffe2fa22ef49de571c53d97cf335b322ee236
Contents?: true
Size: 846 Bytes
Versions: 1
Compression:
Stored size: 846 Bytes
Contents
module Vedeu class NotImplementedError < StandardError; end class Interface def initialize(options = {}) @options = options end def initial_state raise NotImplementedError, 'Subclasses implement this method.' end def event_loop while true do command = input break if command == :stop output(command) end end def input evaluate end def output(command) Compositor.arrange(command, self) end def geometry @geometry ||= Geometry.new(options[:geometry]) end private attr_reader :options def evaluate Commands.execute(read) end def read Terminal.input end def options defaults.merge!(@options) end def defaults { geometry: {} } end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
vedeu-0.0.8 | lib/vedeu/interface/interface.rb |