--000e0ce0b71e8875da04a25420c2
Content-Type: text/plain; charset=ISO-8859-1
Hey Mike-
You can only declare methods private, not variables, and even then, it's
just a suggestion:
class A
private
def foo
"bar"
end
end
a .new
a.send(:foo) # "bar"
-Steve
On Mon, May 2, 2011 at 7:11 PM, Mike Chao <mchao1 / umd.edu> wrote:
> Hey guys, i'm trying to make a class in Ruby and I was wondering if it's
> possible to create public and private instance variables.
>
> -Thanks
>
> --
> Posted via http://www.ruby-forum.com/.
>
>
--000e0ce0b71e8875da04a25420c2--