Class: AocCli::Commands::DaySolve
- Inherits:
-
Object
- Object
- AocCli::Commands::DaySolve
- Defined in:
- lib/aoc_cli/commands.rb
Instance Attribute Summary collapse
-
#ans ⇒ Object
readonly
Returns the value of attribute ans.
-
#day ⇒ Object
readonly
Returns the value of attribute day.
-
#part ⇒ Object
readonly
Returns the value of attribute part.
-
#user ⇒ Object
readonly
Returns the value of attribute user.
-
#year ⇒ Object
readonly
Returns the value of attribute year.
Instance Method Summary collapse
- #defaults ⇒ Object
- #exec ⇒ Object
-
#initialize(args) ⇒ DaySolve
constructor
A new instance of DaySolve.
Constructor Details
#initialize(args) ⇒ DaySolve
Returns a new instance of DaySolve.
63 64 65 66 67 68 69 70 |
# File 'lib/aoc_cli/commands.rb', line 63 def initialize(args) args = defaults.merge(args).compact @user = args[:user] @year = args[:year] @day = args[:day] @part = args[:part] @ans = args[:ans] end |
Instance Attribute Details
#ans ⇒ Object (readonly)
Returns the value of attribute ans.
62 63 64 |
# File 'lib/aoc_cli/commands.rb', line 62 def ans @ans end |
#day ⇒ Object (readonly)
Returns the value of attribute day.
62 63 64 |
# File 'lib/aoc_cli/commands.rb', line 62 def day @day end |
#part ⇒ Object (readonly)
Returns the value of attribute part.
62 63 64 |
# File 'lib/aoc_cli/commands.rb', line 62 def part @part end |
#user ⇒ Object (readonly)
Returns the value of attribute user.
62 63 64 |
# File 'lib/aoc_cli/commands.rb', line 62 def user @user end |
#year ⇒ Object (readonly)
Returns the value of attribute year.
62 63 64 |
# File 'lib/aoc_cli/commands.rb', line 62 def year @year end |
Instance Method Details
#defaults ⇒ Object
77 78 79 80 81 82 |
# File 'lib/aoc_cli/commands.rb', line 77 def defaults {user:Metafile.get(:user), year:Metafile.get(:year), day:Metafile.get(:day), part:Metafile.get(:part)} end |
#exec ⇒ Object
71 72 73 74 75 76 |
# File 'lib/aoc_cli/commands.rb', line 71 def exec Solve::Attempt .new(u:user, y:year, d:day, p:part, a:ans) .respond self end |