Class: AocCli::Year::Progress
- Inherits:
-
Meta
- Object
- Meta
- AocCli::Year::Progress
show all
- Defined in:
- lib/aoc_cli/year.rb
Instance Attribute Summary
Attributes inherited from Meta
#paths, #user, #year
Instance Method Summary
collapse
Methods inherited from Meta
#initialize
Instance Method Details
#cal ⇒ Object
25
26
27
28
|
# File 'lib/aoc_cli/year.rb', line 25
def cal
@cal ||= Requests::Calendar.new(u:user, y:year)
.fill(stars:stats.stars)
end
|
#file ⇒ Object
29
30
31
|
# File 'lib/aoc_cli/year.rb', line 29
def file
Files::Calendar.new(stats:stats, cal:cal).make
end
|
#init_calendar_db ⇒ Object
39
40
41
42
43
|
# File 'lib/aoc_cli/year.rb', line 39
def init_calendar_db
Database::Calendar::Init
.new(u:user, y:year, stars:stats.stars)
.insert
end
|
#stats ⇒ Object
22
23
24
|
# File 'lib/aoc_cli/year.rb', line 22
def stats
@stats ||= Requests::Stats.new(u:user, y:year)
end
|
#write ⇒ Object
35
36
37
38
|
# File 'lib/aoc_cli/year.rb', line 35
def write
File.write(paths.local(f:"Stars"), file) if write?
self
end
|
#write? ⇒ Boolean
32
33
34
|
# File 'lib/aoc_cli/year.rb', line 32
def write?
Prefs.bool(key:"calendar_file")
end
|