def emit(*args)
      if args.size != @arity
        fail ::ArgumentError ,"wrong number of arguments for signal (#{args.size} for #{@arity})"
      end
      @listeners.each do |listener|
        listener.call(*args)
      end
    end
def emit(*args)
      if args.size != @arity
        fail ::ArgumentError ,"wrong number of arguments for signal (#{args.size} for #{@arity})"
      end
      @listeners.each do |listener|
        listener.call(*args)
      end
    end
Initializes the Signal.
 @param [Array<#to_sym>, nil] params the parameter names (the signal will be variadic if nil).
 Calls every connected procedure with given arguments.
 Raises an ArgumentError when the arity is wrong.
 @param args the arguments.