class Grid::Node

Public Class Methods

new() click to toggle source
# File lib/grid/node.rb, line 7
def initialize
  @handler = CommandHandler.new
end

Public Instance Methods

command(name, &block) click to toggle source
# File lib/grid/node.rb, line 17
def command(name, &block)
  @handler.register_command(name, &block)
end
listen(stdin, address) click to toggle source
# File lib/grid/node.rb, line 11
def listen(stdin, address)
  stdin.listen(address) do |command|
    @handler.on_command(command)
  end
end