lib/vedeu/repository/interface.rb in vedeu-0.0.17 vs lib/vedeu/repository/interface.rb in vedeu-0.0.18

- old
+ new

@@ -1,7 +1,9 @@ module Vedeu class Interface + include Queue + attr_accessor :id, :attributes, :active, :name class << self def create(attributes = {}) new(attributes).create @@ -17,20 +19,21 @@ end def create InterfaceRepository.create(self) - InterfaceRepository.activate(self.name) + Compositor.arrange(initial_state) self end - def initial_state - Compositor.arrange([Array.new(geometry.height) { '' }], name) - end - def update + if enqueued? + dequeue + else + [cursor, colour.reset, geometry.origin] + end end def geometry @geometry ||= Geometry.new(attributes) end @@ -42,9 +45,13 @@ def cursor @cursor ? Cursor.show : Cursor.hide end private + + def initial_state + { name => [Array.new(geometry.height) { '' }] } + end def foreground attributes[:fg] || attributes[:foreground] end