title: Methods calling in Ruby
body: <p>I found this code in <a href="https://github.com/ryanb/cancan/wiki/Abilities-in-Database" rel="nofollow">CanCan gem</a> for rails:</p>
  
  <pre><code>def initialize(user)
      can do |action, subject_class, subject|
        user.permissions.find_all_by_action(aliases_for_action(action)).any? do |permission|
          permission.subject_class == subject_class.to_s &amp;&amp;
            (subject.nil? || permission.subject_id.nil? || permission.subject_id == subject.id)
        end
      end
    end
  </code></pre>
  
  <p>I understand that method can be called many times, but how are parameters passed? Where are the variables <code>action</code>, <code>subject_class</code>, and <code>subject</code> initiated?</p>