Class: AocCli::Day::Init
- Inherits:
-
Object
- Object
- AocCli::Day::Init
- Defined in:
- lib/aoc_cli/day.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#day ⇒ Object
readonly
Returns the value of attribute day.
-
#paths ⇒ Object
readonly
Returns the value of attribute paths.
-
#user ⇒ Object
readonly
Returns the value of attribute user.
-
#year ⇒ Object
readonly
Returns the value of attribute year.
Instance Method Summary collapse
-
#initialize(u: Metafile.get(:user), y: Metafile.get(:year), d: Metafile.get(:day)) ⇒ Init
constructor
A new instance of Init.
- #meta ⇒ Object
- #mkdir ⇒ Object
Constructor Details
#initialize(u: Metafile.get(:user), y: Metafile.get(:year), d: Metafile.get(:day)) ⇒ Init
Returns a new instance of Init.
5 6 7 8 9 10 11 12 |
# 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 |
Instance Attribute Details
#day ⇒ Object (readonly)
Returns the value of attribute day.
4 5 6 |
# File 'lib/aoc_cli/day.rb', line 4 def day @day end |
#paths ⇒ Object (readonly)
Returns the value of attribute paths.
4 5 6 |
# File 'lib/aoc_cli/day.rb', line 4 def paths @paths end |
#user ⇒ Object (readonly)
Returns the value of attribute user.
4 5 6 |
# File 'lib/aoc_cli/day.rb', line 4 def user @user end |
#year ⇒ Object (readonly)
Returns the value of attribute year.
4 5 6 |
# File 'lib/aoc_cli/day.rb', line 4 def year @year end |
Instance Method Details
#meta ⇒ Object
17 18 19 20 21 |
# File 'lib/aoc_cli/day.rb', line 17 def File.write(paths.local(f:"meta"), Metafile.day(u:user, y:year, d:day)) self end |