[MacRuby] #1119: Object initalize with a variable length argument shows up as a public method
MacRuby
ruby-noreply at macosforge.org
Tue Jan 18 10:04:17 PST 2011
#1119: Object initalize with a variable length argument shows up as a public
method
------------------------------------------+---------------------------------
Reporter: smorss@… | Owner: lsansonetti@…
Type: defect | Status: new
Priority: blocker | Milestone:
Component: MacRuby | Keywords:
------------------------------------------+---------------------------------
I am running MacRuby 0.8.
If I create a class with an initialize method that takes a variable length
argument:
class XX ; def initialize (*x) ; end ; end
then "XX.new.methods" includes :initialize (to test this, try it in its
own file or a new macirb session, so there are no other classes defined).
initialize should not show up as a public method. If I try to call the
method (e.g. "XX.new.initialize"), it has the proper behavior (says it
can't, because initialize is private). If I create another XX instance,
but pass a parameter, e.g. "XX.new(1).methods", :initialize goes away. If
I call "XX.new.methods" again, :initialize is no longer there as well
(feels like a Ruby class initialization problem).
If I start from scratch and run the same line twice in the same session:
class XX ; def initialize (*x) ; end ; end
class XX ; def initialize (*x) ; end ; end
then "XX.new.methods" no longer contains the initialize method (has the
correct behavior).
--
Ticket URL: <http://www.macruby.org/trac/ticket/1119>
MacRuby <http://macruby.org/>
More information about the macruby-tickets
mailing list