[MacRuby-devel] [MacRuby] #371: Module methods included in the class Module are not visible to other classes.
MacRuby
ruby-noreply at macosforge.org
Fri Oct 9 09:09:41 PDT 2009
#371: Module methods included in the class Module are not visible to other
classes.
---------------------------------+------------------------------------------
Reporter: mred@… | Owner: lsansonetti@…
Type: defect | Status: new
Priority: blocker | Milestone:
Component: MacRuby | Keywords:
---------------------------------+------------------------------------------
Comment(by keith.gautreaux@…):
It seems that MacRuby treats modules differently than Ruby 1.9. You
shouldn't be able to instantiate a named module using the new method, i.e.
A = Module.new do
def meth1
"hello"
end
end
a = A.new (shouldn't work)
=> NoMethodError: undefined method `new' for A:Module
but it does in MacRuby returning an instance of A:Module which responds to
the meth1 call
=> #<A:0x2003da160>
a.meth1
=>"hello"
--
Ticket URL: <http://www.macruby.org/trac/ticket/371#comment:1>
MacRuby <http://macruby.org/>
More information about the MacRuby-devel
mailing list