Class: AocCli::Commands::PrintCal
- Inherits:
-
Object
- Object
- AocCli::Commands::PrintCal
- Defined in:
- lib/aoc_cli/commands.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#year ⇒ Object
readonly
Returns the value of attribute year.
Instance Method Summary collapse
- #defaults ⇒ Object
- #exec ⇒ Object
-
#initialize(args) ⇒ PrintCal
constructor
A new instance of PrintCal.
Constructor Details
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
201 202 203 |
# File 'lib/aoc_cli/commands.rb', line 201 def path @path end |
#year ⇒ Object (readonly)
Returns the value of attribute year.
201 202 203 |
# File 'lib/aoc_cli/commands.rb', line 201 def year @year end |
Instance Method Details
#defaults ⇒ Object
217 218 219 |
# File 'lib/aoc_cli/commands.rb', line 217 def defaults {year:Metafile.get(:year)} end |
#exec ⇒ Object
212 213 214 215 216 |
# 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 |