Sha256: 9d596e472b234b1e4711e411ac704705602267d5f9e52a687cc25dc0da17fb17

Contents?: true

Size: 432 Bytes

Versions: 6

Compression:

Stored size: 432 Bytes

Contents

module Redwood

class UpdateManager
  include Singleton

  def initialize
    @targets = {}
    self.class.i_am_the_instance self
  end

  def register o; @targets[o] = true; end
  def unregister o; @targets.delete o; end

  def relay type, *args
    meth = "handle_#{type}_update".intern
    @targets.keys.each { |o| o.send meth, *args if o.respond_to? meth }
    BufferManager.draw_screen ## TODO: think about this
  end
end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
sup-0.0.2 lib/sup/update.rb
sup-0.0.5 lib/sup/update.rb
sup-0.0.4 lib/sup/update.rb
sup-0.0.1 lib/sup/update.rb
sup-0.0.3 lib/sup/update.rb
sup-0.0.6 lib/sup/update.rb