module JoeAccessors
  class << self
    def joe_accessor_method *args
      args.each do |arg|
        eval <<-src
          def #{ arg }
            @#{ arg }
          end
          def #{ arg }= value
            @#{ arg } = value
          end
        src
      end
    end
  end
end

class Joe
  include JoeAccessors
  joe_accessor_method :arg1, :arg2
end

> test.rb:21: undefined method `joe_accessor_method' for Joe:Class (NoMethodError)

*bangs head against desk*