Hey,
I have been looking around about Module etc… and all I can read is
that Module cannot be instantiated. However the following code works
just fine with Ruby 1.8.7:
==
mod = Module.new
Am I missing something obvious?
Thanks,
Hey,
I have been looking around about Module etc… and all I can read is
that Module cannot be instantiated. However the following code works
just fine with Ruby 1.8.7:
Am I missing something obvious?
Thanks,
On Mar 1, 2011, at 23:46 , JP Billaud wrote:
Am I missing something obvious?
Kinda…
class X; end
=> nilX.new
=> #<X:0x10038cb78>Y = Class.new
=> YY.new
=> #<Y:0x100359c28>Class.new
=> #Class:0x100388b90Class.new.new
=> #<#Class:0x100365028:0x100364f10>
vs:
Z = Module.new
=> ZModule.new
=> #Module:0x100380e90Z.new
NoMethodError: undefined method `new’ for Z:Module
from (irb):11Module.new.new
NoMethodError: undefined method `new’ for #Module:0x10036f848
from (irb):6
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs