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

Example of workable collection usage #8

Closed
j-dexx opened this issue Nov 17, 2015 · 2 comments
Closed

Example of workable collection usage #8

j-dexx opened this issue Nov 17, 2015 · 2 comments

Comments

@j-dexx
Copy link
Contributor

j-dexx commented Nov 17, 2015

Hi, I thought it might be useful to add an example of how to use workable collections.

Basically just:

client = Workable::Client.new(api_key: 'api_key', subdomain: 'your_subdomain')
jobs = client.jobs
loop do
  jobs.each do |job|
    # Do something with the job
  end
  break unless jobs.next_page?
  jobs = jobs.fetch_next_page
end

Using loop because it's matz's preference

Would you like me to add it? If so where would you like it? Using yard in the workable collection class? Or in the readme?

@rwojsznis
Copy link
Owner

Hi, sorry for slight delay, was pretty occupied lately; and sure - feel free to add this info, I think readme should be just fine (somewhere under usage) - as it's loaded by yard anyway. Thanks!

@j-dexx
Copy link
Contributor Author

j-dexx commented Nov 27, 2015

Sorry for the double commit reference - hadn't realised I changed the gitignore on the first one to ignore rubymine files.

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

No branches or pull requests

2 participants