Class: TempestTime::Commands::Timer::Track
- Inherits:
-
TempestTime::Command
- Object
- TempestTime::Command
- TempestTime::Commands::Timer::Track
- Defined in:
- lib/tempest_time/commands/timer/track.rb
Instance Attribute Summary collapse
-
#issue ⇒ Object
readonly
Returns the value of attribute issue.
-
#timer ⇒ Object
readonly
Returns the value of attribute timer.
Instance Method Summary collapse
- #execute! ⇒ Object
-
#initialize(issue) ⇒ Track
constructor
A new instance of Track.
Methods inherited from TempestTime::Command
#command, #date_prompt, #execute, #pastel, #prompt, #spinner, #table, #week_prompt, #with_spinner, #with_success_fail_spinner
Methods included from Helpers::GitHelper
Methods included from Helpers::FormattingHelper
Methods included from Helpers::TimeHelper
#beginning_of_week, #dates_in_range, #end_of_week, #formatted_date, #formatted_date_range, #formatted_time, #formatted_time_for_input, #formatted_time_long, #future_dates, #parsed_time, #past_dates, #past_week_selections, #week_beginnings, #week_dates
Constructor Details
#initialize(issue) ⇒ Track
Returns a new instance of Track.
13 14 15 16 |
# File 'lib/tempest_time/commands/timer/track.rb', line 13 def initialize(issue) @issue = issue || automatic_issue @timer = TempestTime::Models::Timer.new(@issue) end |
Instance Attribute Details
#issue ⇒ Object (readonly)
Returns the value of attribute issue.
11 12 13 |
# File 'lib/tempest_time/commands/timer/track.rb', line 11 def issue @issue end |
#timer ⇒ Object (readonly)
Returns the value of attribute timer.
11 12 13 |
# File 'lib/tempest_time/commands/timer/track.rb', line 11 def timer @timer end |
Instance Method Details
#execute! ⇒ Object
18 19 20 21 22 23 |
# File 'lib/tempest_time/commands/timer/track.rb', line 18 def execute! abort(pastel.red("No timer for #{issue}!")) unless timer.exists? timer.pause track_time timer.delete end |