title: Ruby - Protected method
body: <p>I have the following <code>Ruby</code> program:</p>
  
  <pre><code>class Access
  
  def retrieve_public
  puts "This is me when public..."
  end
  
  private
  def retrieve_private
  puts "This is me when privtae..."
  end
  
  protected
  def retrieve_protected
  puts "This is me when protected..."
  end
  
  end
  
  
  access = Access.new
  access.retrieve_protected
  </code></pre>
  
  <p>When I run it, I get the following:</p>
  
  <pre><code>accessor.rb:23: protected method `retrieve_protected' called for #&lt;Access:0x3925
  758&gt; (NoMethodError)
  </code></pre>
  
  <p>Why is that?</p>
  
  <p>Thanks.</p>