lib/active_configuration/base.rb
# Creates and accepts the configuration details for an Option.
#
# An example of setting an option with a block:
#
#   option :sort do
#     default  'alphabetical'
#     restrict 'alphabetical', 'manual'
#   end
#
# Here, the #option method is called and passed the key of :sort and then the
# the block that follows. The block given to #option is then evaluated against
# a new instance of ActiveConfiguration::Option.
#
# @param [Symbol] key the key for this option and settings against this option.
# @param [Proc] block what should be evaluated against the option.
Creates and accepts the configuration details for an Option.
An example of setting an option with a block.



Here, the #option method is called and passed the key of :sort and then the
the block that follows. The block given to #option is then evaluated against
a new instance of ActiveConfiguration::Option.
Creates and accepts the configuration details for an Option . An example of setting an option with a block . Here the #option method is called and passed the key of : sort and then the the block that follows . The block given to #option is then evaluated against a new instance of ActiveConfiguration :: Option .
def option(key, &block)
      opt = Option.new(key)
      opt.instance_eval(&block)
      @options[key.to_sym] = opt
    end
def option ( key , & block ) opt = Option . new ( key ) opt . instance_eval ( & block ) @options [ key . to_sym ] = opt end
Creates and accepts the configuration details for an Option.
Creates and accepts the configuration details for an Option .
key
<not_specific>
block
<not_specific>
<not_specific>
block what should be evaluated against the option.
block what should be evaluated against the option .