class Ruboty::Toggl::Actions::Stop

Public Instance Methods

call() click to toggle source
# File lib/ruboty/toggl/actions/stop.rb, line 5
def call
  if access_token?
    unless workspace?
      return require_workspace
    end
    stop
    report
  else
    require_access_token
  end
rescue => exception
  message.reply("Failed by #{exception.class}")
end

Private Instance Methods

report() click to toggle source
# File lib/ruboty/toggl/actions/stop.rb, line 25
def report
  project = toggl.get_project(current_time_entry['pid'])
  message.reply("Stop `#{current_time_entry['description']}` in project `#{project['name']}` !")
end
stop() click to toggle source
# File lib/ruboty/toggl/actions/stop.rb, line 21
def stop
  toggl.stop_time_entry current_time_entry["id"]
end