Class: AocCli::Year::Meta
- Inherits:
-
Object
- Object
- AocCli::Year::Meta
- Defined in:
- lib/aoc_cli/year.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#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: Prefs.default_alias, y: Metafile.get(:year)) ⇒ Meta
constructor
A new instance of Meta.
- #write ⇒ Object
Constructor Details
#initialize(u: Prefs.default_alias, y: Metafile.get(:year)) ⇒ Meta
Returns a new instance of Meta.
10 11 12 13 14 15 |
# File 'lib/aoc_cli/year.rb', line 10 def initialize(u:Prefs.default_alias, y:Metafile.get(:year)) @user = Validate.user(u) @year = Validate.year(y) @paths = Paths::Year.new(u:user, y:year) end |
Instance Attribute Details
#paths ⇒ Object (readonly)
Returns the value of attribute paths.
9 10 11 |
# File 'lib/aoc_cli/year.rb', line 9 def paths @paths end |
#user ⇒ Object (readonly)
Returns the value of attribute user.
9 10 11 |
# File 'lib/aoc_cli/year.rb', line 9 def user @user end |
#year ⇒ Object (readonly)
Returns the value of attribute year.
9 10 11 |
# File 'lib/aoc_cli/year.rb', line 9 def year @year end |
Instance Method Details
#write ⇒ Object
16 17 18 19 |
# File 'lib/aoc_cli/year.rb', line 16 def write File.write(paths.local(f:"meta"), Metafile.year(u:user, y:year)) end |