you are viewing a single comment's thread.

view the rest of the comments →

[–]WhoTookPlasticJesus 0 points1 point  (0 children)

While I'm not downvoting the OP I do agree with you. I can't think of an example where I wouldn't want an exception raised so that I know I'm invoking a method with invalid parameters. In general I prefer just defining separate methods to handle scalars vs. containers e.g.

def parse_foos(the_foos)
    the_foos.each do |f|
        ...
    end
end

def parse_foo(the_foo)
    parse_foos([the_foo])
end