class Harvest::Changers::TimeEntry

Public Instance Methods

change(factory, client, _active_user, state, kwargs) click to toggle source
# File lib/harvest/changers.rb, line 6
def change(factory, client, _active_user, state, kwargs)
  # binding.pry
  state[state[:active]].map do |te|
    send(kwargs[:action].to_sym, factory, client, te)
  end
end

Private Instance Methods

restart(factory, client, te) click to toggle source
# File lib/harvest/changers.rb, line 15
def restart(factory, client, te)
  # PATCH /v2/time_entries/{TIME_ENTRY_ID}/restart
  # binding.pry
  [factory.time_entry(client.api_call(client.api_caller("time_entries/#{te.id}/restart", http_method: 'patch')))]
end
stop(factory, client, te) click to toggle source
# File lib/harvest/changers.rb, line 21
def stop(factory, client, te)
  # PATCH /v2/time_entries/{TIME_ENTRY_ID}/stop
  [factory.time_entry(client.api_call(client.api_caller("time_entries/#{te.id}/stop", http_method: 'patch')))]
end