Class: Marvin::IRC::Client::EMConnection

Inherits:
EventMachine::Protocols::LineAndTextProtocol
  • Object
show all
Defined in:
lib/marvin/irc/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ EMConnection

Returns a new instance of EMConnection.



54
55
56
57
58
59
# File 'lib/marvin/irc/client.rb', line 54

def initialize(*args)
  opts = args.extract_options!
  super(*args)
  self.client = Marvin::IRC::Client.new(opts)
  self.client.em_connection = self
end

Instance Attribute Details

#clientObject

Returns the value of attribute client.



52
53
54
# File 'lib/marvin/irc/client.rb', line 52

def client
  @client
end

#portObject

Returns the value of attribute port.



52
53
54
# File 'lib/marvin/irc/client.rb', line 52

def port
  @port
end

#serverObject

Returns the value of attribute server.



52
53
54
# File 'lib/marvin/irc/client.rb', line 52

def server
  @server
end

Instance Method Details

#post_initObject



61
62
63
64
# File 'lib/marvin/irc/client.rb', line 61

def post_init
  client.process_connect
  super
end

#receive_line(line) ⇒ Object



71
72
73
74
# File 'lib/marvin/irc/client.rb', line 71

def receive_line(line)
  Marvin::Logger.debug "<< #{line.strip}"
  self.client.receive_line(line)
end

#unbindObject



66
67
68
69
# File 'lib/marvin/irc/client.rb', line 66

def unbind
  client.process_disconnect
  super
end