class AocCli::Tables::Stats::Day
Attributes
day[R]
Public Class Methods
new(u:Metafile.get(:user), y:Metafile.get(:year), d:Metafile.get(:day))
click to toggle source
Calls superclass method
AocCli::Tables::Stats::Year::new
# File lib/aoc_cli/tables.rb, line 95 def initialize(u:Metafile.get(:user), y:Metafile.get(:year), d:Metafile.get(:day)) super(u:u, y:y) @day = Validate.day(d) @cols = "part, attempts, elapsed" @where = { year:"'#{year}'", day:"'#{day}'", correct:"'1'" } end
Public Instance Methods
headings()
click to toggle source
# File lib/aoc_cli/tables.rb, line 108 def headings ["Part", "Attempts", "Time (h:m:s)"] end
rows()
click to toggle source
# File lib/aoc_cli/tables.rb, line 111 def rows @rows ||= data.map{|d| [d[0], d[1], d[2]]} end
title()
click to toggle source
# File lib/aoc_cli/tables.rb, line 105 def title "Year #{year}: Day #{day}" end