-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve documentation #20
Comments
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 |
@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? |
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. 👍 |
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
The text was updated successfully, but these errors were encountered: