Class: MWIRC::Bot
- Inherits:
-
Object
- Object
- MWIRC::Bot
- Defined in:
- lib/mw-irc.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ Bot
constructor
A new instance of Bot.
- #send(text) ⇒ Object
Constructor Details
#initialize(opts = {}) ⇒ Bot
Returns a new instance of Bot.
6 7 8 9 10 |
# File 'lib/mw-irc.rb', line 6 def initialize(opts={}) raise 'host and port must be specified' if opts[:port].nil? || opts[:host].nil? @host = opts[:host] @port = opts[:port] end |
Class Method Details
.send(text, host, port) ⇒ Object
17 18 19 20 |
# File 'lib/mw-irc.rb', line 17 def self.send(text, host, port) @sock = UDPSocket.open if @sock.nil? @sock.send text, 0, host, port end |