class AocCli::Day::Init

Attributes

day[R]
paths[R]
user[R]
year[R]

Public Class Methods

new(u:Metafile.get(:user), y:Metafile.get(:year), d:Metafile.get(:day)) click to toggle source
# File lib/aoc_cli/day.rb, line 5
def initialize(u:Metafile.get(:user), 
                           y:Metafile.get(:year), 
                           d:Metafile.get(:day))
        @user  = Validate.user(u)
        @year  = Validate.year(y)
        @day   = Validate.day(d)
        @paths = Paths::Day.new(u:user, y:year, d:day)
end

Public Instance Methods

meta() click to toggle source
# File lib/aoc_cli/day.rb, line 17
def meta
        File.write(paths.local(f:"meta"), 
                Metafile.day(u:user, y:year, d:day))
        self
end
mkdir() click to toggle source
# File lib/aoc_cli/day.rb, line 13
def mkdir
        Dir.mkdir(Validate.day_dir(paths.day_dir))
        self
end