https://github.com/bodrovis/rating-chgk-v2
Ruby client for the competitive What? Where? When? (CHGK) API
https://github.com/bodrovis/rating-chgk-v2
api api-client ruby ruby-gem
Last synced: 6 months ago
JSON representation
Ruby client for the competitive What? Where? When? (CHGK) API
- Host: GitHub
- URL: https://github.com/bodrovis/rating-chgk-v2
- Owner: bodrovis
- License: mit
- Created: 2022-01-13T19:29:40.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-11-01T13:55:32.000Z (7 months ago)
- Last Synced: 2024-12-03T19:51:26.890Z (6 months ago)
- Topics: api, api-client, ruby, ruby-gem
- Language: Ruby
- Homepage:
- Size: 156 KB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE.md
- Code of conduct: .github/CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# RatingChgkV2


[](https://coveralls.io/github/bodrovis/rating-chgk-v2?branch=master)

[](https://codeclimate.com/github/bodrovis/rating-chgk-v2/maintainability)Ruby client for [competitive "What? Where? When?" (aka "CHGK") API](http://api.rating.chgk.net/). This gem is a replacement for [ChgkRating](https://github.com/bodrovis/ChgkRating) which worked only with the deprecated API version.
## Installation and requirements
This gem requires Ruby 2.7+. Install it by running:
```
$ gem install rating-chgk-v2
```Include it in your script:
```ruby
require 'rating_chgk_v2'
```## Client initialization
Initialize an API client:
```ruby
@client = RatingChgkV2.client
```Optionally, provide your JWT token and connection options (please note that JWT is not required to access most of the endpoints):
```ruby
@client = RatingChgkV2.client token: 'MY_JWT', params: {open_timeout: 100, timeout: 500}
```Now use client to perform API requests:
```ruby
teams = @client.teams itemsPerPage: 2, name: 'Н', page: 3
```## Usage
**[Please find documentation at our Wiki](https://github.com/bodrovis/rating-chgk-v2/wiki)**.
## Running tests
Tests are written in RSpec (all HTTP requests are stubbed):
```
rspec .
```Observe test results and coverage.
## Copyright and license
Licensed under the [MIT license](./LICENSE.md).
Copyright (c) 2023 [Ilya Bodrov-Krukowski](http://bodrovis.tech)