Class: AocCli::Day::Cache

Inherits:
Pages show all
Defined in:
lib/aoc_cli/day.rb

Instance Attribute Summary

Attributes inherited from Pages

#files, #use_cache

Attributes inherited from Init

#day, #paths, #user, #year

Instance Method Summary collapse

Methods inherited from Pages

#cache, #copy, #download, #load

Methods inherited from Init

#meta, #mkdir

Constructor Details

#initialize(u: Metafile.get(:user), y: Metafile.get(:year), d: Metafile.get(:day), f: [:Input, :Puzzle]) ⇒ Cache

Returns a new instance of Cache.



52
53
54
55
56
57
58
# File 'lib/aoc_cli/day.rb', line 52

def initialize(u:Metafile.get(:user), 
         y:Metafile.get(:year),
         d:Metafile.get(:day),
         f:[:Input, :Puzzle])
  super(u:u, y:y, d:d, f:f)
  paths.create_cache
end

Instance Method Details

#queryObject



59
60
61
# File 'lib/aoc_cli/day.rb', line 59

def query
  files.map{|file| [file, read(file:file)]}.to_h
end