Module question


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 =

Am I missing something obvious?


On Mar 1, 2011, at 23:46 , JP Billaud wrote:

Am I missing something obvious?

class X; end
=> nil
=> #<X:0x10038cb78>

Y =
=> Y
=> #<Y:0x100359c28>
=> #Class:0x100388b90
=> #<#Class:0x100365028:0x100364f10>


Z =
=> Z
=> #Module:0x100380e90
NoMethodError: undefined method `new’ for Z:Module
from (irb):11
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.

| Privacy Policy | Terms of Service | Remote Ruby Jobs