Class: EventMachine::IRC::Server

Inherits:
Connection
  • Object
show all
Defined in:
lib/eventmachine/irc/server.rb,
lib/eventmachine/irc/server/version.rb

Constant Summary collapse

VERSION =
"0.0.1"
@@user_store =
SynchronizedStore.new
@@channel_store =
SynchronizedStore.new
@@config =
{
  'version' => '0.04dev',
  'timeout' => 10,
  'port' => 6667,
  'hostname' => Socket.gethostname.split(/\./).shift,
  'starttime' => Time.now.to_s,
  'nick-tries' => 5
}

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeServer



741
742
743
744
745
# File 'lib/eventmachine/irc/server.rb', line 741

def initialize
  @user_store = @@user_store
  @channel_store = @@channel_store
  @config = @@config
end

Instance Attribute Details

#channel_storeObject (readonly)

Returns the value of attribute channel_store.



739
740
741
# File 'lib/eventmachine/irc/server.rb', line 739

def channel_store
  @channel_store
end

#configObject (readonly)

Returns the value of attribute config.



739
740
741
# File 'lib/eventmachine/irc/server.rb', line 739

def config
  @config
end

#user_storeObject (readonly)

Returns the value of attribute user_store.



739
740
741
# File 'lib/eventmachine/irc/server.rb', line 739

def user_store
  @user_store
end

Class Method Details

.channel_storeObject



731
732
733
# File 'lib/eventmachine/irc/server.rb', line 731

def self.channel_store
  @@channel_store
end

.configObject



735
736
737
# File 'lib/eventmachine/irc/server.rb', line 735

def self.config
  @@config
end

.user_storeObject



727
728
729
# File 'lib/eventmachine/irc/server.rb', line 727

def self.user_store
  @@user_store
end

Instance Method Details

#channelmodesObject



751
752
753
# File 'lib/eventmachine/irc/server.rb', line 751

def channelmodes
  return "bcdefFhiIklmnoPqstv"
end

#post_initObject



755
756
757
# File 'lib/eventmachine/irc/server.rb', line 755

def post_init
  @client = ConnectedClient.new(self)
end

#receive_data(data) ⇒ Object



763
764
765
766
767
# File 'lib/eventmachine/irc/server.rb', line 763

def receive_data(data)
  data.split(/\n/).each do |line|
    @client.receive_data(line)
  end
end

#unbindObject



759
760
761
# File 'lib/eventmachine/irc/server.rb', line 759

def unbind
  @client.handle_quit("disconnected...")
end

#usermodesObject



747
748
749
# File 'lib/eventmachine/irc/server.rb', line 747

def usermodes
  return "aAbBcCdDeEfFGhHiIjkKlLmMnNopPQrRsStUvVwWxXyYzZ0123459*@"
end