apiclient
Version, currently master branch1 version
- master branchlatestAug 21, 2020
github.com/dukenguyenxyz/sgtodo-apiclient
API Client for Spider-Gazelle To-do App
Installation
# Add this to your shard.yml
dependencies:
apiclient:
github: dukenguyenxyz/sgtodo-apiclient
branch: mastermaster is a branch, not a release, so this tracks it rather than pinning a version.
Then run:
shards installshard.yml
- Crystal
0.35.1- License
- MIT
- Author
- Duke Nguyen
- Target
apiclientfrom src/apiclient.cr
Dependencies
Runtime Dependencies
- responsible~> 1.2.0github: place-labs/responsible
Development Dependencies
- ameba~> 0.13.1github: veelenga/amebadev
- webmock~> 0.13.0github: manastech/webmock.cr, branch: masterdev
README
apiclient
API Client for Interacting with Spider-Gazelle To-do API
Installation
Clone this repository into your directory and require "__dirname/src/apiclient.cr"
Usage
All methods are stored under module Apiclient. All methods are referenced in src/apiclient.cr.
WebMocks are enabled by default in specs. To turn them off to test the live API, please follow instructions to comment and uncomment code detailed in spec/*
Methods
Spider-gazelle To-do API Client supports a single stream and re-uses HTTP connection. To open a stream, simply call client = Apiclient.open, the client variable is loaded as the first argument for all Apiclient module methods. The methods are listed as below:
-
Get this list of all tasks
Apiclient.index(client) -
Find a single task
Apiclient.show(client, :id) -
Create a task
Apiclient.create(client, :body) -
Update a task
Apiclient.update(client, :id, :body) -
Destroy a task
Apiclient.destroy(client, :id) -
Destroy all tasks
Apiclient.destroy_all(client)
When all operations are finished, simply call client.close to close the stream
Params
- Request object
id: String
body: {title : String, order : Int32?, completed : Bool}
- Response object
struct ObjectReponse
include JSON::Serializable
getter id : Int32
getter title : String
getter order : Int32?
getter completed : Bool
getter url : String
end
Contributing
- Fork it (https://github.com/your-github-user/apiclient/fork)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Contributors
- Duke Nguyen - creator and maintainer
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This branch
- Branch
master- Seen
- Aug 21, 2020
- Crystal
0.35.1- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/dukenguyenxyz/sgtodo-apiclient
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 15, 2026
- Synced
- Aug 15, 2026
- Versions
- 1