From: Marc Heiler Date: 2013-04-04T09:36:20+09:00 Subject: Eigenclass: why this syntax? Hi. Consider this syntax: module Foo class << self attr_accessor :use_colours end end Now, it works to do this: Foo.use_colours = true puts Foo.use_colours Foo.use_colours = false puts Foo.use_colours My questions: - Why is the syntax "class << self" used? For an array, << means to append. I am unsure what this means for class, or why this syntax was used. - Also, in the above example, is it possible to query the @use_colours variable for when instance methods of module Foo are mixed into a class? I would like to mixin instance variables that are defined on the instance level of the module, inside methods defined in that module. So yeah, basically I want to use a module like a class, but it seems ruby gives obstacles to that attempt. -- Posted via http://www.ruby-forum.com/.