From: Sigurd Date: 2012-08-05T03:32:50+09:00 Subject: Re: Why does it fail? def Module1::Module2.hello Because it's how it defined in ruby syntax: def class; dot or color; method name You can't use nesting in it. So it's limited on a lexer level. On Aug 4, 2012, at 9:07 PM, Iņaki Baz Castillo wrote: > 2012/8/4 William Herry : >> I know one way to define module method >> >> module Module1::Module2 >> def self.hello >> puts 'HELLO' >> end >> end > > Sure, but what I ask is why this works: > > def Module1.hello ; end > > end this fails: > > def Module1::Module2.hello ; end > > > > -- > Iņaki Baz Castillo > >