From: Matma Rex Date: 2013-01-10T07:26:24+09:00 Subject: Re: Extending class On Wed, 09 Jan 2013 23:12:31 +0100, Damjan Rems wrote: > Is there a clear way of extending classes? `extend Something` is mostly the same as `class << self; include Something; end`. The `class << something` syntax opens the "singleton class" (aka "eigenclass") of `something`; include is just your regular include. For example: module MyModule def test; puts "Hello world!"; end end class MyClass class << self include MyModule end end MyClass.test # => Hello world! The combination means that the methods included from MyModule end up as class methods of MyClass. -- Matma Rex