Ruby: module A vs class A::B -


so, can have (a):

module     class b     end end 

and can have (b):

class a::b end 

why use a instead of b , vice versa?

when defining a::b first time, have take first option. otherwise, second option saves indentation , more compact, useful when want write a::b concisely , independent of other things in a.


Comments

Popular posts from this blog

java - Spring Data JPA: Why findOne(id) executing delete query internally? -

python - Mongodb How to add addtional information when aggregating? -

java - Incorrect order of records in M-M relationship in hibernate -