def dsl_accessor(name, *default, &block)
      variable = "@#{name}"
      define_method(name) do |*args|
        if args.empty?
          result = instance_variable_get(variable)
          if result.nil?
            result = if default.empty?
              block && instance_eval(&block)
            elsif default.size == 1
              default.first
            else
              default
            end
            instance_variable_set(variable, result)
            result
          else
            result
          end
        else
          instance_variable_set(variable, args.size == 1 ? args.first : args)
        end
      end
    end
def dsl_accessor(name, *default, &block)
      variable = "@#{name}"
      define_method(name) do |*args|
        if args.empty?
          result = instance_variable_get(variable)
          if result.nil?
            result = if default.empty?
              block && instance_eval(&block)
            elsif default.size == 1
              default.first
            else
              default
            end
            instance_variable_set(variable, result)
            result
          else
            result
          end
        else
          instance_variable_set(variable, args.size == 1 ? args.first : args)
        end
      end
    end
This method creates a dsl accessor named _name_. If nothing else is given
 as argument it defaults to nil. If <i>*default</i> is given as a single
 value it is used as a default value, if more than one value is given the
 _default_ array is used as the default value. If no default value but a
 block _block_ is given as an argument, the block is executed everytime
 the accessor is read <b>in the context of the current instance</b>.

 After setting up the accessor, the set or default value can be retrieved
 by calling the method +name+. To set a value one can call <code>name
 :foo</code> to set the attribute value to <code>:foo</code> or
 <code>name(:foo, :bar)</code> to set it to <code>[ :foo, :bar ]</code>.