Yard doc cleanup 2

This commit is contained in:
Thomas Reynolds 2012-05-02 11:18:16 -07:00
parent 2965e3709d
commit 7b8457d963
3 changed files with 24 additions and 21 deletions

View file

@ -61,15 +61,14 @@ module Middleman
# Either get the cached key or save the contents of the block
#
# @param Anything Hash can use as a key
# @return Cached value
# @param key Anything Hash can use as a key
def fetch(*key)
@cache[key] ||= yield
end
# Whether the key is in the cache
#
# @param Anything Hash can use as a key
# @param key Anything Hash can use as a key
# @return [Boolean]
def has_key?(key)
@cache.has_key?(key)
@ -77,31 +76,34 @@ module Middleman
# Get a specific key
#
# @param Anything Hash can use as a key
# @return Cached value
# @param key Anything Hash can use as a key
def get(key)
@cache[key]
end
# Array of keys
# @return [Array]
def keys
@cache.keys
end
# Clear the entire cache
# @return [void]
def clear
@cache = {}
end
# Set a specific key
#
# @param Anything Hash can use as a key
# @param Cached value
# @param key Anything Hash can use as a key
# @param value Cached value
# @return [void]
def set(key, value)
@cache[key] = value
end
# Remove a specific key
# @param Anything Hash can use as a key
# @param key Anything Hash can use as a key
def remove(*key)
@cache.delete(key)
end