0.0
Repository is archived
Low commit activity in last 3 years
No release in over a year
Opinionated Ruby client for the competitive What? Where? When? rating WebAPI (rating.chgk.info) that allows to work with data as with Ruby objects
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 3.6
~> 13.0
~> 6.0
~> 0.1
~> 1.31

Runtime

 Project Readme

ChgkRating

Gem Version CI Test Coverage

This gem is in passive maintenance mode. I won't release any new features or introduce any complex enhancements as ChgkRating v1 is deprecated. Please use rating-chgk-v2 gem which works with the new version of the API.

Ruby interface for the rating.chgk.info WebAPI. This is not just a wrapper, but rather a quite complex opinionated client that allows to easily work with various API resources.

Competitive CHGK (aka "What? Where? When?") is a popular intellectual game where teams of up to six people are trying to find an answers to various questions.

The main documentation can be found at the official website.

Документация на русском языке также доступна на официальном сайте.

Documentation can also be found on RubyDoc.

Installation and Requirements

This gem works only with Ruby 2.4+ and I have no plans of making it compatible with older versions. Apart from that, it has no special requirements.

Install it by running:

$ gem install chgk_rating

A Very Quick Example

# Instantiate the client:
client = ChgkRating.client

# Get all players:
client.players 

# Get a specific team:
team = client.team 1 

# Get information about the team at a given tournament:
team.at_tournament 1000 

# Get results for the given team as the tournament:
team.at_tournament(1000).results

# The same data can be fetched with: 
client.team_results_at_tournament 1000, team

# Or you can even grab the tournament and pass it later:
tournament = client.tournament 1000

team.at_tournament(tournament).results
# OR
client.team_results_at_tournament tournament, team

Testing

Tests run against mock responses so you don't need to perform any special setup. Simply pull the code and run:

$ bundle install
$ rspec . 

License

This plugin is licensed under the MIT License.

Copyright (c) Ilya Krukowski