On Thu, 24 May 2001, bashar asad wrote:

> hi
> I initialize it and it worked ... but when can I use the attr_reader as a
> short cut
>
You could do something like
  class SomeClass
    attr_reader :name1, :name2

    def initialize(name1, name2)
      @name1 = name1
      @name2 = name2
    end
  end

  nClass = SomeClass.new("hello1", "hello2")

  puts nClass.name1  # => "hello1"
  puts nClass.name2  # => "hello2"

Jim


=========================================================
Jim Freeze
jim / freeze.org
---------------------------------------------------------
No comment at this time.
http://www.freeze.org
=========================================================