Top Level Namespace

Defined Under Namespace

Modules: Balotelli

Instance Method Summary collapse

Instance Method Details

#Balotelli(server, name, pass, channels, log = false) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/balotelli/balotelli_helper.rb', line 3

def Balotelli(server, name, pass, channels, log = false)
  Class.new(Balotelli::Base) do
    Balotelli::Module.constants.each do |c|
      if c != :Base && (m = Balotelli::Module.const_get(c)).is_a?(Module)
        register(m)
      end
    end
    include Balotelli::Core::IrcLogger.new('.', 'logs.log', channels) if log
  end.tap do |c|
    c.configure(*Balotelli::Config.build(server, name, pass))
    c.connect { channels.each(&method(:join)) }
  end
end