class BadLinkFinder::ResultCache

Public Class Methods

new() click to toggle source
# File lib/bad_link_finder/result_cache.rb, line 6
def initialize
  @cache = {}
end

Public Instance Methods

fetch(key) click to toggle source
# File lib/bad_link_finder/result_cache.rb, line 14
def fetch(key)
  @cache[stripped_key(key)]
end
store(key, link) click to toggle source
# File lib/bad_link_finder/result_cache.rb, line 10
def store(key, link)
  @cache[stripped_key(key)] = link
end

Protected Instance Methods

stripped_key(key) click to toggle source
# File lib/bad_link_finder/result_cache.rb, line 20
def stripped_key(key)
  key.sub(/#.*$/, '')
end