Sha256: be6e76bd4ee4b05c9a5bb9b988e2d345e60f248a69cbd90572ebfce6501a3101

Contents?: true

Size: 474 Bytes

Versions: 4

Compression:

Stored size: 474 Bytes

Contents

module GetToWork
  class Command
    class Stop < GetToWork::Command
      def run
        if last_timer
          shell.say "\nStopping your current timer...\n\n", :green
          result = harvest_service.stop_timer(last_timer)

          if result["id"]
            config_file.data.delete("last_timer")
            config_file.save
          end
        else
          shell.say "\nYour timer has already been stopped.\n\n", :red
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
get_to_work-0.1.5 lib/get_to_work/command/stop.rb
get_to_work-0.1.4 lib/get_to_work/command/stop.rb
get_to_work-0.1.3 lib/get_to_work/command/stop.rb
get_to_work-0.1.2 lib/get_to_work/command/stop.rb