[Nitro] HasManyCollection#each

itsme213 itsme213 at hotmail.com
Fri Nov 25 21:18:43 EST 2005


Given:

class A
  property :name, String
  def initialize n
    @name = n
  end
end

class B
  property :name, String
  has_many :as, A
end

b = B.new
b.add_a(A.new "a1")
b.add_a(A.new "a2")

B.new.as.each {|a| puts a.name}

#=> I see nothing. Should I see a1, a2?




More information about the Nitro-general mailing list