[MacRuby] #461: each_object: NoMethodError
#461: each_object: NoMethodError -------------------------------------+-------------------------------------- Reporter: jordan.breeding@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: -------------------------------------+-------------------------------------- This code (from Patrick -- http://gist.github.com/242894): {{{ module ObjectSpace def each_instance_of(klass) each_object do |obj| yield(obj) if obj.instance_of? klass end end def each_kind_of(klass) each_object do |obj| yield(obj) if obj.kind_of? klass end end end include ObjectSpace class Foo; end x, y, z = Foo.new, Foo.new, Foo.new class Bar; end a = Bar.new each_instance_of(Foo) { |x| p x } }}} This works in 1.8 and 1.9, but in MacRuby it currently gives this: {{{ ./test.rb:3:in `each_instance_of:': undefined method `each_object' for main:TopLevel (NoMethodError) from ./test.rb:21:in `<main>' }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/461> MacRuby <http://macruby.org/>
#461: each_object: NoMethodError -------------------------------------+-------------------------------------- Reporter: jordan.breeding@… | Owner: lsansonetti@… Type: defect | Status: closed Priority: blocker | Milestone: MacRuby 0.5 Component: MacRuby | Resolution: fixed Keywords: | -------------------------------------+-------------------------------------- Changes (by lsansonetti@…): * status: new => closed * resolution: => fixed * milestone: => MacRuby 0.5 Comment: Should be fixed in r3058. {{{ $ ./miniruby t.rb #<Foo:0x200055e60> #<Foo:0x200060aa0> #<Foo:0x200064620> }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/461#comment:1> MacRuby <http://macruby.org/>
participants (1)
-
MacRuby