Commits

Kevin Bullock committed 14e01bc

configurable: update docs to remove refs to default_config

  • Participants
  • Parent commits 60e2d8d

Comments (0)

Files changed (2)

  Doodad::Config              # => a ConfigStruct::Struct
  Doodad::Config::Bar         # => another ConfigStruct::Struct
 
- Doodad.default_config       # => #<struct Doodad::Config
+ Doodad::Config.defaults     # => #<struct Doodad::Config
                              #     bar=#<struct Doodad::Config::Bar
                              #          quux=42, wibble=nil>,
                              #     baz=nil,
                              #     foo="default">
 
- Doodad.config               # => a (deep) copy of default_config,
+ Doodad.config               # => a (deep) copy of Doodad::Config.defaults,
                              #    ready for use
 
  Doodad.config.replace(      # replaces config with passed values

lib/configurable.rb

 #
 # This creates a ConfigStruct::Struct called Doodad::Config, along with
 # a frozen instance of it containing the default options accessible with
-# the Doodad.default_config method (see ConfigAccessors.default_config).
+# the Doodad::Config.defaults method (see ConfigStructDefaults).
 #
 # You can then use Doodad.config (see ConfigAccessors.config) to store
 # the configuration for your class. See ConfigStruct::Struct for the
     klass.extend ConfigAccessors
   end
 
-  # Returns the class' default configuration object.
-  def default_config
+  def default_config #:nodoc:
     self.class.default_config
   end
 
     # configuration struct will be created as Doodad::Config.)
     #
     # You may also declare options with default settings, which will
-    # then be available thru the default_config method on your class
-    # (e.g. Doodad.default_config; see documentation on
-    # ConfigAccessors.default_config). To declare defaults, pass them as
-    # hash parameters:
+    # then be available thru the Config::defaults method on the
+    # generated struct (e.g. Doodad::Config.defaults; see documentation
+    # on ConfigStructDefaults). To declare defaults, pass them as hash
+    # parameters:
     #
     #     configurable_options :one => 1, :two => 2
     #
   # Accessors for the class' default configuration to add to the
   # generated Config module.
   module ConfigStructDefaults
-    # The class' default configuration.
+    # The class' default configuration object. This object is a frozen
+    # instance of the Config struct (which is a ConfigStruct::Struct
+    # created by the Macros.configurable_options method).
     attr_accessor :defaults
   end
 
       @_config ||= config_struct.defaults.dup # dup unfreezes
     end
 
-    # Returns the class' default configuration object. This object is a
-    # frozen instance of the class' Config struct (which is a
-    # ConfigStruct::Struct created by the Macros.configurable_options
-    # method).
-    def default_config
+    def default_config #:nodoc:
       raise NameError, 'use configurable_options to define settings' unless
         config_struct
       config_struct.defaults