def register(*args, &block)

      clear = args.first.is_a?(Hash) ? args.pop[:clear] : true

      if args.size > 0
        register_participant(*args, &block)
      else
        proxy = ParticipantRegistrationProxy.new(self, clear)
        block.arity < 1 ? proxy.instance_eval(&block) : block.call(proxy)
        proxy._flush
      end
    end
def register(*args, &block)

      clear = args.first.is_a?(Hash) ? args.pop[:clear] : true

      if args.size > 0
        register_participant(*args, &block)
      else
        proxy = ParticipantRegistrationProxy.new(self, clear)
        block.arity < 1 ? proxy.instance_eval(&block) : block.call(proxy)
        proxy._flush
      end
    end
A shorter version of #register_participant

   dashboard.register 'alice', MailParticipant, :target => 'alice@example.com'

 or a block registering mechanism.

   dashboard.register do
     alpha 'Participants::Alpha', 'flavour' => 'vanilla'
     participant 'bravo', 'Participants::Bravo', :flavour => 'peach'
     catchall ParticipantCharlie, 'flavour' => 'coconut'
   end

 Originally implemented in ruote-kit by Torsten Schoenebaum.

 == registration in block and :clear

 By default, when registering multiple participants in block, ruote
 considers you're wiping the participant list and re-adding them all.

 You can prevent the clearing by stating :clear => false like in :

   dashboard.register :clear => false do
     alpha 'Participants::Alpha', 'flavour' => 'vanilla'
     participant 'bravo', 'Participants::Bravo', :flavour => 'peach'
     catchall ParticipantCharlie, 'flavour' => 'coconut'
   end