# frozen_string_literal: true require "active_resource" module Toggl class TimeEntry < ActiveResource::Base self.site = "https://www.toggl.com/api/v8/" self.include_root_in_json = true self.include_format_in_path = false def self.user RenuoCliConfig.toggl_api_token end def self.password "api_token" end def self.current data = get(:current)["data"] data ? new(data) : nil end def self.start(params) post(:start, {}, params.to_json) end def stop put(:stop) end end end