def attributes=(attributes = {})
      attributes.each_pair { |k, v|
        respond_to?(name = "#{k}=") and send(name, v) or self[k] = v
      }
    end
def attributes=(attributes = {})
      attributes.each_pair { |k, v|
        respond_to?(name = "#{k}=") and send(name, v) or self[k] = v
      }
    end
Apply a given hash of attributes to a record.

 @return [Hash]
 @param attributes [Hash] A hash of attributes.