Class: Flamethrower::EventConnection

Inherits:
EventMachine::Connection
  • Object
show all
Includes:
Connection
Defined in:
lib/flamethrower/server/event_server.rb

Constant Summary

Constants included from Irc::Codes

Irc::Codes::ERR_BADCHANNELKEY, Irc::Codes::ERR_UNKNOWNCOMMAND, Irc::Codes::RPL_CHANNELMODEIS, Irc::Codes::RPL_ENDOFMOTD, Irc::Codes::RPL_ENDOFNAMES, Irc::Codes::RPL_ENDOFWHO, Irc::Codes::RPL_MOTD, Irc::Codes::RPL_MOTDSTART, Irc::Codes::RPL_NAMEREPLY, Irc::Codes::RPL_NOWAWAY, Irc::Codes::RPL_TOPIC, Irc::Codes::RPL_UMODEIS, Irc::Codes::RPL_UNAWAY, Irc::Codes::RPL_WHOREPLY, Irc::Codes::RPL_WLCM

Instance Attribute Summary collapse

Attributes included from Connection

#campfire_connection, #current_user, #dispatcher, #irc_channels

Instance Method Summary collapse

Methods included from Connection

#after_connect, #initialize, #populate_irc_channels, #populate_my_user, #receive_data, #send_message, #send_messages

Methods included from Irc::Commands

#error, #reply, #send_channel_list, #send_channel_mode, #send_join, #send_motd, #send_nowaway, #send_part, #send_pong, #send_rename, #send_topic, #send_unaway, #send_user_mode, #send_userlist, #send_welcome, #send_who

Instance Attribute Details

#serverObject

Returns the value of attribute server.



5
6
7
# File 'lib/flamethrower/server/event_server.rb', line 5

def server
  @server
end

Instance Method Details

#stopObject



11
12
13
14
15
# File 'lib/flamethrower/server/event_server.rb', line 11

def stop
  irc_channels.map do |channel|
    channel.to_campfire.stop
  end
end

#streams_alive?Boolean

Returns:

  • (Boolean)


17
18
19
20
21
# File 'lib/flamethrower/server/event_server.rb', line 17

def streams_alive?
  irc_channels.any? do |channel|
    channel.to_campfire.alive?
  end
end

#unbindObject



7
8
9
# File 'lib/flamethrower/server/event_server.rb', line 7

def unbind
  @server.connections.delete(self)
end