I have the following code:
#!/usr/bin/ruby
class Person
  def self.speak
    p = self.new
    puts "Hello"
    p.chatter
  end
private
  def chatter
    puts "Chattering"
  end
end
p = Person.new
Person.speak
I'd like to make chatter private, accessible only within p.. but I want p to be able to access it within the class method. Is there a better way to design this so chatter isn't available to the public, but a "factory" method like self.speak can call chatter?