ruby-lol

Gem Version Coverage Status Build Status Code Climate

ruby-lol is a wrapper to the Riot Games API.

Installation

Add this line to your application's Gemfile:

    gem 'ruby-lol'

And then execute:

$ bundle

Or install it yourself as:

$ gem install ruby-lol

Usage

    require 'lol'

    # defaults to euw
    client = Lol::Client.new "my_api_key"
    # => <Lol::Client:0x007fd09d1abb00 @api_key="my_api_key", @region="euw">

    # na
    na_client = Lol::Client.new "my_api_key", :region => "na"
    # => <Lol::Client:0x007fd09d1abb00 @api_key="my_api_key", @region="na">

    # gets all champions
    champions = client.champion
    # => Array of Lol::Champion

    # let's play a bit, who is free to play?
    client.champion.select {|c| c.free_to_play }.map {|c| c.name}
    # => %w(Aatrox Cassiopeia Lux Malphite MissFortune MonkeyKing Nautilus Sivir Talon Taric)

    # it's time to fetch some of my games, isn't it?
    games = client.game my_summoner_id
    # => Array of Lol::Game

    # let's get one game and look into it
    game = games.first

    # who was I playing with?
    game.fellow_players
    # => Array of Lol::Player

    # gimme some stats!
    game.statistics
    # => Array of Lol::RawStatistic

    # let's get some info about my Leagues now
    leagues = client.league my_summoner_id
    # => Array of Lol::League

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