This gem is for educational use only. I have created this to have a practice on how to create an API wrapper for Rails and create it in a ruby gem.
Add this line to your application's Gemfile:
gem 'challonge_user_rails'And then execute:
$ bundle install
Or install it yourself as:
$ gem install challonge_user_rails
Create an account on Challonge Website and get an API via Settings - Developer API.
Instance of the client must be done first before being able to use the API. You may check Rails docs to setup your API key via credentials.yml.
client = ChallongeUserRails::Client.new(api_key: [YOUR API KEY])client.tournamentsTournament URL is the URL parameter (not the address) of the tournament when you create it.
client.tournament(tournament_url)client.delete_tournament(tournament_url)Challonge API expects a json data with attributes related to creation of a tournament. You may refer to their docs for an example json value.
client.create_tournament(data)client.matches(tournament_url)client.match(tournament_url, match_id)Check this repo to see how this gem is used.
Bug reports and pull requests are welcome on GitHub at https://github.com/michael-dollosa/challonge_user_rails. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.
The gem is available as open source under the terms of the MIT License.
Everyone interacting in the ChallongeUserRails project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.