How to create validations for initialized variables?
===

I have a variable `value` that is initialized when I create a new object. However, this variable is not a column of my table. I just want to use it inside my model and have it available for some methods inside my class:

    class MyClass < ActiveRecord::Base
      def initialize (value)
        @value = value
      end
    end
So, when a create a new object `@value` will keep the `some text` temporarily, for example:

    test = MyClass.new("some text")

There is a way to validates the variable `value` to accept only text?

    class MyClass < ActiveRecord::Base
      validates_format_of :value => /^\w+$/ # it doesn't work
      
      def initialize (value)
        @value = value
      end
    end

