def attribute_set(name, value)
      property = properties[name]
      if property
        value = property.typecast(value)
        self.persistence_state = persistence_state.set(property, value)
      end
    end
def attribute_set(name, value)
      property = properties[name]
      if property
        value = property.typecast(value)
        self.persistence_state = persistence_state.set(property, value)
      end
    end
Sets the value of the attribute and marks the attribute as dirty
 if it has been changed so that it may be saved. Do not set from
 instance variables directly, but use this method. This method
 handles the lazy loading the property and returning of defaults
 if nessesary.

 @example
   class Foo
     include DataMapper::Resource

     property :first_name, String
     property :last_name,  String

     def full_name(name)
       name = name.split(' ')
       attribute_set(:first_name, name[0])
       attribute_set(:last_name, name[1])
     end

     # using the shorter syntax
     def name_from_address_book(name)
       name = name.split(', ')
       self.first_name = name[1]
       self.last_name = name[0]
     end
   end

 @param [Symbol] name
   name of attribute to set
 @param [Object] value
   value to store

 @return [undefined]

 @api public