lib/abstract_preferences.rb
def inherited(klass)
        super
        method = klass.name.split('::').last.scan(/[A-Z][a-z]*/).map { |x| x.downcase }.join('_')
        Preferences.class_eval "def #{method}; #{klass.name}.instance end", __FILE__, __LINE__
      end
# Defines a reader method for the Namespace subclass on the Preferences instance.
#
# Defines a class <tt>Preferences::Keyword</tt> and <tt>preferences.keyword</tt>:
#
#   class Preferences
#     class Keyword < Namespace
#       defaults_accessor :an_option, true
#     end
#   end
Defines a reader method for the Namespace subclass on the Preferences instance.
Defines a class Preferences::Keyword and preferences.keyword.

class Preferences
class Keyword < Namespace
defaults_accessor :an_option, true
end
end
Defines a reader method for the Namespace subclass on the Preferences instance . Defines a class Preferences :: Keyword and preferences . keyword . class Preferences class Keyword < Namespace defaults_accessor : an_option true end end
def inherited(klass)
        super
        method = klass.name.split('::').last.scan(/[A-Z][a-z]*/).map { |x| x.downcase }.join('_')
        Preferences.class_eval "def #{method}; #{klass.name}.instance end", __FILE__, __LINE__
      end
def inherited ( klass ) super method = klass . name . split ( '::' ) . last . scan ( / [A-Z][a-z]* / ) . map { | x | x . downcase } . join ( '_' ) Preferences . class_eval "def #{method}; #{klass.name}.instance end" , __FILE__ , __LINE__ end
Defines a reader method for the Namespace subclass on the Preferences instance.
Defines a reader method for the Namespace subclass on the Preferences instance .
klass