Skip to content
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

Open
etagwerker opened this issue Nov 3, 2018 · 7 comments
Open

Improve documentation #20

etagwerker opened this issue Nov 3, 2018 · 7 comments
Labels
enhancement New feature or request

Comments

@etagwerker
Copy link
Member

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

@toobulkeh
Copy link

toobulkeh commented Feb 16, 2019

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!

@cleicar
Copy link

cleicar commented Oct 25, 2019

@etagwerker @bronzdoc is this issue already done? Looks like there is already a link to the documentation.

@bronzdoc
Copy link
Contributor

@cleicar where's the link to the documentation?

@etagwerker
Copy link
Member Author

etagwerker commented Oct 30, 2019

@bronzdoc bronzdoc added enhancement New feature or request and removed Hacktoberfest labels Aug 11, 2021
@fwolfst
Copy link

fwolfst commented Jan 31, 2022

I find the proposed addition very valuable. Was also exactly the information I was searching for (ended up reading the code, not the documentation).

@fwolfst
Copy link

fwolfst commented Jan 31, 2022

Would you accept a PR with that change (in the readme)?

@etagwerker
Copy link
Member Author

@fwolfst Sure thing. Go for it. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants