title: Error: Attempt to call private method
body: <p>Coming from a long history of C-style syntax and now trying to learn Ruby (on Rails), I've been having my share of issues with its idioms and such, but today I hit one I didn't expect to have a problem with and I can't see whatever it is that must be right in front of my face.</p>
  
  <p>I have a Binary class that includes a private method to derive a URI value from a path value (uri and path are attributes of the class). I'm calling <code>self.get_uri_from_path()</code> from within <code>Binary.upload()</code>, but I get:</p>
  
  <pre><code>Attempt to call private method
  </code></pre>
  
  <p>A snippet of the model looks like this:</p>
  
  <pre><code>class Binary &lt; ActiveRecord::Base
    has_one :image
  
    def upload( uploaded_file, save = false )
      save_as = File.join( self.get_bin_root(), '_tmp', uploaded_file.original_path )
  
      # write the file to a temporary directory
      # set a few object properties
  
      self.path   = save_as.sub( Rails.root.to_s + '/', '' )
      self.uri    = self.get_uri_from_path()
    end
  
    private
  
    def get_uri_from_path
      return self.path.sub( 'public', '' )
    end
  end
  </code></pre>
  
  <p>Am I making the call incorrectly? Am I missing something else that's even more fundamental? The only place that <code>Binary.get_uri_from_path()</code> is being called from - at the moment - is <code>Binary.upload()</code>. I'd expect to be able to call a private method from within the same class unless Ruby does something markedly different from other languages I've used.</p>
  
  <p>Thanks.</p>