# File lib/couchrest/mixins/properties.rb, line 57
      def cast_keys
        return unless self.class.properties
        self.class.properties.each do |property|
          next unless property.casted
          key = self.has_key?(property.name) ? property.name : property.name.to_sym
          # Don't cast the property unless it has a value
          next unless self[key]   
          target = property.type
          if target.is_a?(Array)
            klass = ::CouchRest.constantize(target[0])
            self[property.name] = self[key].collect do |value|
              # Auto parse Time objects
              obj = ( (property.init_method == 'new') && klass == Time) ? Time.parse(value) : klass.send(property.init_method, value)
              obj.casted_by = self if obj.respond_to?(:casted_by)
              obj 
            end
          else
            # Auto parse Time objects
            self[property.name] = if ((property.init_method == 'new') && target == 'Time')
              # Using custom time parsing method because Ruby's default method is toooo slow 
              self[key].is_a?(String) ? Time.mktime_with_offset(self[key].dup) : self[key]
            # Float instances don't get initialized with #new
            elsif ((property.init_method == 'new') && target == 'Float')
              cast_float(self[key])
            # 'boolean' type is simply used to generate a property? accessor method
            elsif ((property.init_method == 'new') && target == 'boolean')
              self[key]
            else
              # Let people use :send as a Time parse arg
              klass = ::CouchRest.constantize(target)
              klass.send(property.init_method, self[key].dup)   
            end  
            self[property.name].casted_by = self if self[property.name].respond_to?(:casted_by)
          end 
          
        end
        
        def cast_float(value)
          begin 
            Float(value)
          rescue 
            value
          end
        end
        
      end