From: tamouse mailing lists Date: 2013-05-11T04:50:35+09:00 Subject: Re: What is module in Ruby? Is there any standard (any strict rules) to define module? On Fri, May 10, 2013 at 2:15 PM, Wins Lin wrote: > What is a module in Ruby? > > For now I can't see any standard that could help me to define a module. > > They say that "a module == a directory". But that's not true. > In Rails they define modules just as they want. Some are bound with a > directory with the same name, others are just plain files. > > E.g. in ActiveRecord there is a line: >>> autoload :SessionStore > > So session_store has to be: > 1) a module > 2) a directory with the same name (/session_store/*) > > But session_store is: > 1) a class > 2) and a simple file, no any directory. > > And there are many more similar examples. > > So where is the standard of module definition in Ruby? What are the > rules? > > -- > Posted via http://www.ruby-forum.com/. > In Ruby, very simply, a Module defines a scope and a namespace. But that is hugely simplistic. I highly recommend reading "Metaprogramming Ruby" for some real insight on this, as well as the good old pickaxe book. There are many fine additional references at the end of https://duckduckgo.com/?q=what+is+a+ruby+module%3F