Method: Mtodos::Cache#initialize

Defined in:
lib/mtodos.rb

#initializeCache

Returns a new instance of Cache.



9
10
11
12
13
14
15
16
17
18
# File 'lib/mtodos.rb', line 9

def initialize
  @cache_filename = 'mtodos.cache'
  @cache_file = File.join(Dir.pwd, @cache_filename)
  if File.file?(@cache_file)
    @hash = Marshal.load(File.read(@cache_file))
  else
    @hash = {}
    File.write(@cache_file, Marshal.dump(@hash))
  end
end