class AocCli::Commands::PrintCal

Attributes

path[R]
year[R]

Public Class Methods

new(args) click to toggle source
# File lib/aoc_cli/commands.rb, line 202
def initialize(args)
        args  = defaults.merge(args).compact
        @year = Validate.year(args[:year])
end

Public Instance Methods

defaults() click to toggle source
# File lib/aoc_cli/commands.rb, line 217
def defaults
        {year:Metafile.get(:year)}
end
exec() click to toggle source
# File lib/aoc_cli/commands.rb, line 212
def exec
        Prefs.bool(key:"calendar_file") ?
                system("cat #{path} | less") :
                puts("You have disabled calendar files")
end