Class: Bamboozled::API::TimeTracking

Inherits:
Base
  • Object
show all
Defined in:
lib/bamboozled/api/time_tracking.rb

Instance Attribute Summary

Attributes inherited from Base

#api_key, #subdomain

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Bamboozled::API::Base

Instance Method Details

#add(time_tracking_details) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/bamboozled/api/time_tracking.rb', line 8

def add(time_tracking_details)
  # details = generate_xml(time_tracking_details)
  details = time_tracking_details.to_json
  options = { body: details, headers: { 'Content-Type' => 'application/json' } }

  request(:post, "timetracking/add/", options)
end

#adjust(time_tracking_id, hours_worked) ⇒ Object



16
17
18
19
20
21
# File 'lib/bamboozled/api/time_tracking.rb', line 16

def adjust(time_tracking_id, hours_worked)
  details = { timeTrackingId: time_tracking_id, hoursWorked: hours_worked }.to_json
  options = { body: details, headers: { 'Content-Type' => 'application/json' } }

  request(:put, "timetracking/adjust", options)
end

#record(time_tracking_id) ⇒ Object



4
5
6
# File 'lib/bamboozled/api/time_tracking.rb', line 4

def record(time_tracking_id)
  request(:get, "timetracking/record/#{time_tracking_id}")
end