class TimeLogRobot::Toggl::Tagger

Public Class Methods

update(entry_id:) click to toggle source
# File lib/time_log_robot/toggl/tagger.rb, line 9
def update(entry_id:)
  put("/#{entry_id}", basic_auth: auth, headers: headers, body: body)
end

Private Class Methods

auth() click to toggle source
# File lib/time_log_robot/toggl/tagger.rb, line 15
def auth
  {
    username: token,
    password: "api_token"
  }
end
body() click to toggle source
# File lib/time_log_robot/toggl/tagger.rb, line 30
def body
  {
    time_entry:
    {
      tags: tags
    }
  }.to_json
end
headers() click to toggle source
# File lib/time_log_robot/toggl/tagger.rb, line 26
def headers
  { 'Content-Type' => 'application/json' }
end
tags() click to toggle source
# File lib/time_log_robot/toggl/tagger.rb, line 39
def tags
  [ENV['TOGGL_DEFAULT_LOG_TAG']]
end
token() click to toggle source
# File lib/time_log_robot/toggl/tagger.rb, line 22
def token
  ENV['TOGGL_TOKEN']
end