vendor/bundle/ruby/1.8/gems/Ruby-MemCache-0.0.1/lib/memcache.rb
### Restore the specified value +val+ from the form inserted into the cache,
### given the specified +flags+.
Restore the specified value +val+ from the form inserted into the cache,
given the specified +flags+.
Restore the specified value + val + from the form inserted into the cache given the specified + flags + .
def restore( val, flags=0 )
		self.debug_msg( "Restoring value %p (flags: %d)", val, flags )
		rval = val.dup
		if (flags & F_ESCAPED).nonzero?
			rval = URI::unescape( rval )
		end
		if (flags & F_COMPRESSED).nonzero?
			rval = Zlib::ZStream::Inflate::inflate( rval )
		end
		if (flags & F_SERIALIZED).nonzero?
			rval = Marshal::load( rval )
		end
		if (flags & F_NUMERIC).nonzero?
			if /\./.match( rval )
				rval = Float( rval )
			else
				rval = Integer( rval )
			end
		end
		return rval
	end
def restore ( val , flags = 0 ) self . debug_msg ( "Restoring value %p (flags: %d)" , val , flags ) rval = val . dup if ( flags & F_ESCAPED ) . nonzero? rval = URI :: unescape ( rval ) end if ( flags & F_COMPRESSED ) . nonzero? rval = Zlib :: ZStream :: Inflate :: inflate ( rval ) end if ( flags & F_SERIALIZED ) . nonzero? rval = Marshal :: load ( rval ) end if ( flags & F_NUMERIC ) . nonzero? if / \. / . match ( rval ) rval = Float ( rval ) else rval = Integer ( rval ) end end return rval end
Restore the specified value +val+ from the form inserted into the cache,
given the specified +flags+.
Restore the specified value + val + from the form inserted into the cache given the specified + flags + .
# De-urlencode # Decompress # Unserialize
val
flags