Class: AocCli::Commands::AttemptsTable
- Inherits:
-
Object
- Object
- AocCli::Commands::AttemptsTable
- Defined in:
- lib/aoc_cli/commands.rb
Instance Attribute Summary collapse
-
#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) ⇒ AttemptsTable
constructor
A new instance of AttemptsTable.
Constructor Details
#initialize(args) ⇒ AttemptsTable
Returns a new instance of AttemptsTable.
148 149 150 151 152 153 154 |
# File 'lib/aoc_cli/commands.rb', line 148 def initialize(args) args = defaults.merge(args).compact @user = args[:user] @year = args[:year] @day = args[:day] @part = args[:part] end |
Instance Attribute Details
#day ⇒ Object (readonly)
Returns the value of attribute day.
147 148 149 |
# File 'lib/aoc_cli/commands.rb', line 147 def day @day end |
#part ⇒ Object (readonly)
Returns the value of attribute part.
147 148 149 |
# File 'lib/aoc_cli/commands.rb', line 147 def part @part end |
#user ⇒ Object (readonly)
Returns the value of attribute user.
147 148 149 |
# File 'lib/aoc_cli/commands.rb', line 147 def user @user end |
#year ⇒ Object (readonly)
Returns the value of attribute year.
147 148 149 |
# File 'lib/aoc_cli/commands.rb', line 147 def year @year end |
Instance Method Details
#defaults ⇒ Object
159 160 161 162 163 164 |
# File 'lib/aoc_cli/commands.rb', line 159 def defaults {user:Metafile.get(:user), year:Metafile.get(:year), day:Metafile.get(:day), part:Metafile.get(:part)} end |
#exec ⇒ Object
155 156 157 158 |
# File 'lib/aoc_cli/commands.rb', line 155 def exec Tables::Attempts.new(u:user, y:year, d:day, p:part).print self end |