------ art_5077_15701646.1214502709497
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
The final result.
def add_notifier(notifier l, &block)
raise ArgumentError, "Nil notifier. You must provide a Proc or a
block" if notifier.nil? && block.nil?
@notifiers << (notifier || block)
end
On Thu, Jun 26, 2008 at 10:19 AM, Ben Bleything <ben / bleything.net> wrote:
> On Thu, Jun 26, 2008, Jess Gabriel y Galn wrote:
> > I think you could end up adding some nils with
> > this solution and the previous one, if I call:
> >
> > Heartbeat.new.add_notifier
> >
> > without any argument or block.
>
> Right, this is why I suggested modifying the block to handle the nils :)
>
> Ben
>
>
------ art_5077_15701646.1214502709497--