A simple gem that provides a client for the Todoable API.
Add this line to your application's Gemfile:
gem 'todoable'And then execute:
$ bundle
Or install it yourself as:
$ gem install todoable
There are Lists and Items, defined and implemented via Dry-struct.
Gateway to query the API.
.allreturns an array ofListobjects.by_id(:id[, :id[, ...]])returns an array ofListobjects whoseIDs match the provided:ids.[:id]returns aListobject with the matching:id
.create(name: '')creates a newListvia the API and returns aListobject.update(id: :id, name: '')updates the givenListvia the API and returns aListobject with the new attributes.delete(<List>[, <List>[, ...]])deletes list(s)
Items are only queryable through Lists
.allraises aTodoable::NotAccessibleError.by_idraises aTodoable::NotAccessibleError.[:id]raises aTodoable::NotAccessibleError
.create(list_id: :id, name: ''[, finished_at: <ISO8601 Formatted String>])creates a newItemonListvia the API and returns anItemobject.finish(<Item>)updates theItemas finished, and returns the updatedItemobject.update(with any parameters) raises an exception.delete(<Item>[, <Item>[, ...]])deletes items
The class for an immutable struct-like object that has name, src, id, and has zero or more Items.
#refetchfetches and returns a newListwith this object's ID#deletedeletes theListvia the API, returns true or false
The class for an immutable struct-like object that has name, finished_at, src, id, and has one List.
#refetchfetches and returns a newItemwith this object's ID#deletedeletes theItemvia the API, returns true or false
After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install.
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/todoable. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
The gem is available as open source under the terms of the MIT License.
Everyone interacting in the Todoable project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.