Sha256: 4aebae9397cea8d5cee71f4f93c2c7c1da4004652c90c9eab87fcd3cc7d55891

Contents?: true

Size: 1.55 KB

Versions: 5

Compression:

Stored size: 1.55 KB

Contents

# RatingChgkV2

![Gem](https://img.shields.io/gem/v/rating-chgk-v2)
![CI](https://github.com/bodrovis/rating-chgk-v2/actions/workflows/ci.yml/badge.svg)
[![Test Coverage](https://codecov.io/gh/bodrovis/rating-chgk-v2/graph/badge.svg)](https://codecov.io/gh/bodrovis/rating-chgk-v2)

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) 2022 [Ilya Bodrov-Krukowski](http://bodrovis.tech)

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rating-chgk-v2-1.3.0 README.md
rating-chgk-v2-1.2.0 README.md
rating-chgk-v2-1.1.0 README.md
rating-chgk-v2-1.0.1 README.md
rating-chgk-v2-1.0.0 README.md