Sha256: 9115a77ead5fbdc3701d5edb0b59ffb8d5ca1a1c795b78b8254319ad044a2fc1

Contents?: true

Size: 500 Bytes

Versions: 2

Compression:

Stored size: 500 Bytes

Contents

require 'drb'

# The God::Server oversees the DRb server which dishes out info on this God daemon.

module God

  class Server
    attr_reader :host, :port

    def initialize(meddle = nil, host = nil, port = nil)
      @meddle = meddle
      @host = host
      @port = port || 7777
      start
    end

    def method_missing(*args, &block)
      @meddle.send(*args, &block)
    end

    private

    def start
      @drb ||= DRb.start_service("druby://#{@host}:#{@port}", self) 
    end
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
god-0.2.0 lib/god/server.rb
god-0.1.0 lib/god/server.rb