title: How to create a private class method?
body: <p>How come this approach of creating a private class method works:</p>
  
  <pre><code>class Person
  
    def self.get_name
      persons_name
    end
  
    class &lt;&lt; self
  
      private
  
      def persons_name
        "Sam"
      end
    end
  end
  
  puts "Hey, " + Person.get_name
  puts "Hey, " + Person.persons_name  #=&gt; raises "private method `persons_name' called for Person:Class (NoMethodError)"
  </code></pre>
  
  <p>But this does not:</p>
  
  <pre><code>class Person
  
    def self.get_name
      persons_name
    end
  
    private
  
    def self.persons_name
      "Sam"
    end
  end
  
  puts "Hey, " + Person.get_name
  puts "Hey, " + Person.persons_name
  </code></pre>