#--
# TODO Perhaps need to make a check against overriding Megas annotated version.
#++

class Module

  # Create an attribute method for both getting
  # and setting an instance variable.
  #
  #   attr_setter :a
  #
  # _is equivalent to_
  #
  #   def a(*args)
  #     if args.size > 0
  #       @a = args[0]
  #       self
  #     else
  #       @a
  #     end
  #   end
  #
  def attr_setter(*args)

    make = {}
    args.each { |a|
      make["#{a}".to_sym] = %{
        def #{a}(*args)
          args.size > 0 ? ( @#{a}=args[0] ; self ) : @#{a}
        end
      }
    }
    module_eval( make.values.join("\n") )

    return make.keys
  end

end



#  _____         _
# |_   _|__  ___| |_
#   | |/ _ \/ __| __|
#   | |  __/\__ \ |_
#   |_|\___||___/\__|
#
# TODO
