I'm trying to implement `each' method for my class:
class Packages
def initialize()
@packages = Hash.new()
ObjectSpace.each_object(Package) {|x|
@packages[x.name] = x
}
puts "Collect #{@packages.length} items"
end
def each
@packages.each
end
end
This gives an error:
./package.rb:124:in `each': yield called out of block (LocalJumpError)
from ./package.rb:124:in `each'
from test1.rb:7
What did I do wrong?
--
> No manual is ever necessary.
May I politely interject here: BULLSHIT. That's the biggest Apple lie of all!
(Discussion in comp.os.linux.misc on the intuitiveness of interfaces.)