[MacRuby] #1277: singleton_methods/ancestors
MacRuby
ruby-noreply at macosforge.org
Fri May 13 22:44:17 PDT 2011
#1277: singleton_methods/ancestors
--------------------------------+-------------------------------------------
Reporter: anoiaque@… | Owner: lsansonetti@…
Type: enhancement | Status: new
Priority: major | Milestone: MacRuby 1.0
Component: MacRuby | Keywords: singleton
--------------------------------+-------------------------------------------
Comment(by lsansonetti@…):
Yes, you should expect MacRuby to behave as CRuby 1.9.2. In this case,
clearly #singleton_methods isn't working. Otherwise, #ancestors behaves as
expected, because Object is a shortcut to NSObject and BasicObject is not
the root class of all objects.
{{{
$ ./miniruby -e "class User; def self.all; end; end; p
User.singleton_methods; p User.ancestors"
[]
[User, NSObject, Kernel]
$ ruby1.9 -e "class User; def self.all; end; end; p
User.singleton_methods; p User.ancestors"
[:all]
[User, Object, Kernel, BasicObject]
}}}
--
Ticket URL: <http://www.macruby.org/trac/ticket/1277#comment:1>
MacRuby <http://macruby.org/>
More information about the macruby-tickets
mailing list