lib/ohm/expire.rb
def update_ttl new_ttl=nil
            # Load default if no new ttl is specified
            new_ttl = self._default_expire if new_ttl.nil?
            # Make sure we have a valid value
            new_ttl = -1 if !new_ttl.to_i.is_a?(Fixnum) || new_ttl.to_i < 0
            # Update indices
            Ohm.redis.expire(self.key, new_ttl)
            Ohm.redis.expire("#{self.key}:_indices", new_ttl)
        end
def update_ttl new_ttl=nil
            # Load default if no new ttl is specified
            new_ttl = self._default_expire if new_ttl.nil?
            # Make sure we have a valid value
            new_ttl = -1 if !new_ttl.to_i.is_a?(Fixnum) || new_ttl.to_i < 0
            # Update indices
            Ohm.redis.expire(self.key, new_ttl)
            Ohm.redis.expire("#{self.key}:_indices", new_ttl)
        end
def update_ttl new_ttl = nil # Load default if no new ttl is specified new_ttl = self . _default_expire if new_ttl . nil? # Make sure we have a valid value new_ttl = - 1 if ! new_ttl . to_i . is_a? ( Fixnum ) || new_ttl . to_i < 0 # Update indices Ohm . redis . expire ( self . key , new_ttl ) Ohm . redis . expire ( "#{self.key}:_indices" , new_ttl ) end
Update the ttl

 ==== Attributes

 * +new_ttl <i>Fixnum</i>+ - The new expire amount. If nil, value will fallback to default expire

 ==== Returns

 * nil

 ==== Examples

   d = Model.create(:hash => "123")
   d.update_ttl(30)
Update the ttl