|
def listen( *args, &blok )
if args[0].kind_of? Symbol
if args.size == 2
args[1].each { |match| @listener << [args[0], match, blok] }
else
@listener << [args[0], /.*/, blok]
end
elsif args[0].kind_of? Array
if args.size == 2
args[0].each { |match| @listener << [nil, match, args[1]] }
else
args[0].each { |match| @listener << [ start_element:start_element, match, blok ] }
end
else
@listener << [nil, /.*/, args[0]]
end
end
|