petems / riot_api

A Ruby wrapper for the Riot API for League of Legends - https://developer.riotgames.com/api/
MIT License
12 stars 3 forks source link

Riot API

Gem Version Coverage Status Build Status Dependency Status

A Ruby wrapper around connecting to the Riot API

Early days yet, but trying to make it as modular as possible :cat:

Installation

Add this line to your application's Gemfile:

gem 'riot_api'

And then execute:

$ bundle

Or install it yourself as:

$ gem install riot_api

Usage:

First, you'll need to go to http://developer.riotgames.com/ and get an API key.

require 'riot_api'

# Create Instace of the API
ra = RiotApi::API.new :api_key => 'API_KEY_HERE', :region => 'euw', :debug => true

# Search by Summoner name
summoner_details = ra.summoner.name('Best Lux EUW')
#<Hashie::Rash id=44600324 name="Best Lux EUW" profile_icon_id=7 revision_date=1375116256000 revision_date_str="07/29/2013 04:44 PM UTC" summoner_level=6>

summoner.name # => "Best Lux EUW"

Methods

RiotApi::API
  #summoner
    #name(summoner_name)
      should return information from a given summoner name
    #id(summoner_name)
      should return information from a given summoner id
    #names(summoner_name_1, summoner_name_2)
      should return an array of summoners with name set
  #stats
    #ranked(summoner_name)
      should return ranked information from a given summoner name
    #summary(summoner_name)
      should return summary information from a given summoner id
  #champions
    #list
      should return a list of all champions
    #free
      should return a list of all free champions
  #game
    #recent(summoner_name)
      should return a list of recent games played from a given summoner id
  #league
    #by_summoner(summoner_name)
      should return leagues data from a given summoner id
  #team
    #by_summoner(summoner_id)
      should return team data from a given summoner id

ChangeLog / History / Releases

see the CHANGELOG.md file.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Testing

bundle install

If adding new test:

RECORDING=1 RIOT_API_KEY=your-api-key rspec

If running existing tests:

rspec

Contributors

For more information and a complete list see the contributor page on GitHub.

License

MIT

Thanks