Method: Storyboard::Cache#initialize

Defined in:
lib/storyboard/cache.rb

#initialize(file_hash) ⇒ Cache

Returns a new instance of Cache.



6
7
8
9
10
11
12
13
14
# File 'lib/storyboard/cache.rb', line 6

def initialize(file_hash)
  @hash = file_hash
  @file = File.join(Dir.tmpdir, "#{file_hash}.storyboard")
  if File.exists?(@file)
    @data = JSON.parse(File.read(@file))
  end
  @data = {'downloads' => {}} if @data.nil? || old?
  @data['lastran'] = Time.now.to_s
end