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 = 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/.
>
>