def assign_attributes( attributes )
        attributes = resolve_attributes( attributes )

        self.class.attributes.each do |key, options|
          as = options[ :as ] # Alias support
          next unless attributes.key?( key ) || ( as && attributes.key?( as ) )
          value = attributes[ key ]
          value ||= attributes[ as ] if as

          if build = options[:build]
            value = build_value( build, value )
          end

          send :"assign_#{ key }", value
        end
      end
def assign_attributes( attributes )
        attributes = resolve_attributes( attributes )

        self.class.attributes.each do |key, options|
          as = options[ :as ] # Alias support
          next unless attributes.key?( key ) || ( as && attributes.key?( as ) )
          value = attributes[ key ]
          value ||= attributes[ as ] if as

          if build = options[:build]
            value = build_value( build, value )
          end

          send :"assign_#{ key }", value
        end
      end
@!visibility public

 Assign a hash of values to the matching instance variables.

 @param [Hash] attributes to assign.

 @return [self]