Class: Dude::Toggl::Base
- Inherits:
-
Object
show all
- Defined in:
- lib/dude/time_trackers/toggl/base.rb
Instance Method Summary
collapse
Instance Method Details
#projects_response ⇒ Object
15
16
17
|
# File 'lib/dude/time_trackers/toggl/base.rb', line 15
def projects_response
toggl_api.get("/api/v8/workspaces/#{Dude::SETTINGS.dig(:toggl, :workspace_id)}/projects")
end
|
#toggl_api ⇒ Object
8
9
10
11
12
13
|
# File 'lib/dude/time_trackers/toggl/base.rb', line 8
def toggl_api
Faraday.new('https://api.track.toggl.com') do |conn|
conn.basic_auth Dude::SETTINGS.dig(:toggl, :token), 'api_token'
conn.['Content-Type'] = 'application/json'
end
end
|