harvesting
harvesting copied to clipboard
Improve documentation
I realize that examples in the README.md are not the best way to document the behavior of this gem.
It would be great if we could point people to this page so that they could see complete documentation of the librtary: https://www.rubydoc.info/github/ombulabs/harvesting/Harvesting/Client#clients-instance_method
~~How do you create a single time entry using Harvesting?~~
This was the closest I could get, since I didn't want to use an ENV variable for the access_token:
class HarvestService < ApplicationService
def initialize(access_token:,account_id:)
@client = Harvesting::Client.new(access_token: access_token, account_id: account_id)
end
def take_day_off(date:)
entry = Harvesting::Models::TimeEntry.new(
{
# user_id: defaults to access token user
project_id: project.id,
task_id: task.id,
spent_date: date,
started_time: "9:00am",
ended_time: "5:00pm",
},
client: @client
)
@client.create(entry)
end
protected
def project(name: )
@client.projects.entries.first
end
def task(name: )
@client.tasks.entries.first
end
end
that extra client:
option was quite confusing. I'm excited about your TODO.md!
@etagwerker @bronzdoc is this issue already done? Looks like there is already a link to the documentation.
@cleicar where's the link to the documentation?
@bronzdoc @cleicar here it is: https://rubydoc.info/github/fastruby/harvesting
I find the proposed addition very valuable. Was also exactly the information I was searching for (ended up reading the code, not the documentation).
Would you accept a PR with that change (in the readme)?
@fwolfst Sure thing. Go for it. 👍