def initialize(options={})
@hostmask = options[:hostmask]
@hostmask ||= /^.+?\.(.+)$/
@hostmask = @hostmask.to_rx(false) if @hostmask.kind_of? String
if @hostmask.kind_of? Regexp then
mask = @hostmask
@hostmask = lambda do |host|
if matches = host.match(mask) then matches[1] else nil end
end
end
@hosts = options[:host]
@hosts ||= options[:hosts]
raise "You must give the host address of an administrator to use nick-based authentication." unless @hosts
@hosts = [ @hosts ] unless @hosts.kind_of? Array
end