lib/parameters/class_methods.rb
def parameter(name,options={})
      name = name.to_sym

      # define the reader class method for the parameter
      meta_def(name) do
        get_param(name).value
      end

      # define the writer class method for the parameter
      meta_def("#{name}=") do |value|
        get_param(name).value = value
      end

      # define the ? method, to determine if the parameter is set
      meta_def("#{name}?") do
        !!get_param(name).value
      end

      # define the reader instance methods for the parameter
      define_method(name) do
        get_param(name).value
      end

      # define the writter instance methods for the parameter
      define_method("#{name}=") do |value|
        get_param(name).value = value
      end

      # define the ? method, to determine if the parameter is set
      define_method("#{name}?") do
        !!get_param(name).value
      end

      # create the new parameter
      new_param = Parameters::ClassParam.new(
        name,
        options[:type],
        options[:description],
        options[:default]
      )

      # add the parameter to the class params list
      params[name] = new_param
      return new_param
    end
def parameter(name,options={})
      name = name.to_sym

      # define the reader class method for the parameter
      meta_def(name) do
        get_param(name).value
      end

      # define the writer class method for the parameter
      meta_def("#{name}=") do |value|
        get_param(name).value = value
      end

      # define the ? method, to determine if the parameter is set
      meta_def("#{name}?") do
        !!get_param(name).value
      end

      # define the reader instance methods for the parameter
      define_method(name) do
        get_param(name).value
      end

      # define the writter instance methods for the parameter
      define_method("#{name}=") do |value|
        get_param(name).value = value
      end

      # define the ? method, to determine if the parameter is set
      define_method("#{name}?") do
        !!get_param(name).value
      end

      # create the new parameter
      new_param = Parameters::ClassParam.new(
        name,
        options[:type],
        options[:description],
        options[:default]
      )

      # add the parameter to the class params list
      params[name] = new_param
      return new_param
    end
Adds a new parameters to the class.

 @param [Symbol, String] name
   The name of the new parameter.

 @param [Hash] options
   Additional options.

 @option options [Class, Array[Class]] :type
   The type to enforce the parameter values to.

 @option options [Object, Proc] :default
   The default value for the new parameter.

 @option options [String] :description
   The description for the new parameter.

 @example
   parameter 'var'

 @example
   parameter 'var', :default => 3, :description => 'my variable'

 @api public