Class: IRC::Server::Link

Inherits:
Object show all
Defined in:
lib/failirc/server/link.rb

Constant Summary collapse

@@callbacks =
{
}

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(server, socket, listen) ⇒ Link

Returns a new instance of Link.



29
30
31
32
33
# File 'lib/failirc/server/link.rb', line 29

def initialize (server, socket, listen)
    @server = server
    @socket = socket
    @listen = listen
end

Instance Attribute Details

#hostObject (readonly)

Returns the value of attribute host.



27
28
29
# File 'lib/failirc/server/link.rb', line 27

def host
  @host
end

#listenObject (readonly)

Returns the value of attribute listen.



27
28
29
# File 'lib/failirc/server/link.rb', line 27

def listen
  @listen
end

#serverObject (readonly)

Returns the value of attribute server.



27
28
29
# File 'lib/failirc/server/link.rb', line 27

def server
  @server
end

#socketObject (readonly)

Returns the value of attribute socket.



27
28
29
# File 'lib/failirc/server/link.rb', line 27

def socket
  @socket
end

Instance Method Details

#raw(text) ⇒ Object



35
36
37
# File 'lib/failirc/server/link.rb', line 35

def raw (text)
    @socket.puts text
end

#send(type, *args) ⇒ Object



39
40
41
42
# File 'lib/failirc/server/link.rb', line 39

def send (type, *args)
    callback = @@callbacks[type]
    callback(args)
end