Class, Module and Object are instances of the Class class. >> Class.class => Class >> Module.class => Class >> Object.class => Class
Class inherits from Module, which inherits from Object >> Class.superclass => Module >> Module.superclass => Object So, every instance of the Class class is_a?(Class) and is_a?(Module) and is_a?(Object). 2012/9/22 John Merlino <stoici...@aol.com> > >> reload! > Reloading... > => true > >> puts Class < Module > true > => nil > >> puts Module < Class > false > => nil > >> puts Module < Object > true > => nil > >> puts Object < Module > false > => nil > >> Object.parent > => Object > > The above indicates that the Class object instance inherits from the > Module object instance and the Module object instance inherits from > Object. And Object doesn't inherit from anything. > > So why do these return true: > > >> Module.is_a?(Class) > => true > >> Object.is_a?(Module) > => true > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk@googlegroups.com. > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.