Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Message from discussion how private is private in ruby?

View parsed - Show only message text

Path: g2news1.google.com!news1.google.com!proxad.net!news.wiretrip.org!news2.arglkargh.de!noris.net!not-for-mail
From: "Peter Ertl" <pe...@gmx.org>
Newsgroups: comp.lang.ruby
Subject: how private is private in ruby?
Date: Thu, 27 Oct 2005 04:32:36 +0900
Lines: 22
Message-ID: <3224.1130355152@www78.gmx.net>
NNTP-Posting-Host: sinus.lauschmusik.de
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Trace: ork-un.noris.net 1130355229 21667 213.95.32.201 (26 Oct 2005 19:33:49 GMT)
X-Complaints-To: news@noris.net
NNTP-Posting-Date: Wed, 26 Oct 2005 19:33:49 +0000 (UTC)
X-received-from: This message has been automatically forwarded from
   the ruby-talk mailing list by a gateway at lauschmusik.de. If it is
   SPAM, it did not originate at lauschmusik.de. Please report the 
   original sender, and not us. Thanks!
   Please see http://hypermetrics.com/rubyhacker/clrFAQ.html#tag24 to.
X-ML-Name: ruby-talk
X-Mail-Count: 162802
X-ruby-talk: <3224.1130355...@www78.gmx.net>
X-rubymirror: yes

Why is this allowed / possible?

class MyUltraSecretKeystore
  private
  def key
    return "nobody-should-read-this-ever"
  end
end

ks = MyUltraSecretKeystore.new

$ puts ks.send(:key)
> "nobody-should-read-this-ever"

*yuk*

so I can just use [public] for _everything_ as well, right?

Best regards
Peter



Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google