Passing Parameters to before_filter

I've just noticed that before_filter can absorb a block in order to
pass parameters to pre-executed actions. Here's an example:

   
before_filter{|c| c.authorized(1)} 


However, in such case, action authorized must be public, while in the tradtional way,

   
before_filter :authorized


the action can be in any visibility. I wonder why...

你可能感兴趣的:(C++,c,C#)