ruby-lol 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +7 -2
- data/lib/lol/league.rb +33 -1
- data/lib/lol/version.rb +1 -1
- data/spec/lol/league_spec.rb +25 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 40594303990be0131e05065ee27214203ddc6c34
|
4
|
+
data.tar.gz: c145a0e4c8e88a5d078bd2899108646b48d63a31
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 93d7b18857c428884b43d7eb71262c7211ca2c400f107f3ec3d3fbf66251374b433fed299bfceee92c04ce41e45d8f59ae5f87e659106aa1f2bea94ee1c3aa6f
|
7
|
+
data.tar.gz: a47eeabc90db1141c5222ffdd4b16d1fd2491127ee1503e22427c44853f2dc9ac7412032b643ba38fc1e0c46d35967319d179b63874f90b6114e6d81c2f83307
|
data/README.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# ruby-lol
|
2
|
-
[](https://coveralls.io/r/mikamai/ruby-lol) [](https://travis-ci.org/mikamai/ruby-lol) [](https://codeclimate.com/repos/52a9908c56b102320a0166a4/feed)
|
2
|
+
[](http://badge.fury.io/rb/ruby-lol) [](https://coveralls.io/r/mikamai/ruby-lol) [](https://travis-ci.org/mikamai/ruby-lol) [](https://codeclimate.com/repos/52a9908c56b102320a0166a4/feed)
|
3
3
|
|
4
4
|
ruby-lol is a wrapper to the [Riot Games API](https://developer.riotgames.com).
|
5
5
|
|
@@ -7,7 +7,9 @@ ruby-lol is a wrapper to the [Riot Games API](https://developer.riotgames.com).
|
|
7
7
|
|
8
8
|
Add this line to your application's Gemfile:
|
9
9
|
|
10
|
+
```ruby
|
10
11
|
gem 'ruby-lol'
|
12
|
+
```
|
11
13
|
|
12
14
|
And then execute:
|
13
15
|
|
@@ -19,11 +21,12 @@ Or install it yourself as:
|
|
19
21
|
|
20
22
|
## Usage
|
21
23
|
|
24
|
+
```ruby
|
22
25
|
require 'lol'
|
23
26
|
|
24
27
|
# defaults to euw
|
25
28
|
client = Lol::Client.new "my_api_key"
|
26
|
-
|
29
|
+
# => <Lol::Client:0x007fd09d1abb00 @api_key="my_api_key", @region="euw">
|
27
30
|
|
28
31
|
# na
|
29
32
|
na_client = Lol::Client.new "my_api_key", :region => "na"
|
@@ -36,6 +39,8 @@ Or install it yourself as:
|
|
36
39
|
# let's play a bit, who is free to play?
|
37
40
|
client.champion.select {|c| c.free_to_play }.map {|c| c.name}
|
38
41
|
# => %w(Aatrox Cassiopeia Lux Malphite MissFortune MonkeyKing Nautilus Sivir Talon Taric)
|
42
|
+
```
|
43
|
+
|
39
44
|
## Contributing
|
40
45
|
|
41
46
|
1. Fork it
|
data/lib/lol/league.rb
CHANGED
@@ -1,4 +1,36 @@
|
|
1
1
|
module Lol
|
2
|
-
|
2
|
+
# Holds the representation of a League
|
3
|
+
class League < Model
|
4
|
+
# @!attribute [r] raw
|
5
|
+
# @return [String] raw version of options Hash used to initialize League
|
6
|
+
attr_reader :raw
|
7
|
+
|
8
|
+
# @!attribute [r] timestamp
|
9
|
+
# @return [String] timestamp of league snapshot
|
10
|
+
attr_reader :timestamp
|
11
|
+
|
12
|
+
# @!attribute [r] name
|
13
|
+
# @return [String] name of league
|
14
|
+
attr_reader :name
|
15
|
+
|
16
|
+
# @!attribute [r] tier
|
17
|
+
# @return [String] tier of league
|
18
|
+
attr_reader :tier
|
19
|
+
|
20
|
+
# @!attribute [r] queue
|
21
|
+
# @return [String] type of queue
|
22
|
+
attr_reader :queue
|
23
|
+
|
24
|
+
# @!attribute [r] entries
|
25
|
+
# @return [String] summoners / teams in queue
|
26
|
+
attr_reader :entries
|
27
|
+
|
28
|
+
private
|
29
|
+
|
30
|
+
attr_writer :timestamp, :name, :tier, :queue
|
31
|
+
|
32
|
+
def entries= list
|
33
|
+
"foo"
|
34
|
+
end
|
3
35
|
end
|
4
36
|
end
|
data/lib/lol/version.rb
CHANGED
data/spec/lol/league_spec.rb
CHANGED
@@ -1,2 +1,27 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
require "lol"
|
3
|
+
|
4
|
+
include Lol
|
5
|
+
|
6
|
+
describe League do
|
7
|
+
it "inherits from Lol::Model" do
|
8
|
+
expect(League.ancestors[1]).to eq(Model)
|
9
|
+
end
|
10
|
+
|
11
|
+
context "initialization" do
|
12
|
+
it_behaves_like 'Lol model' do
|
13
|
+
let(:valid_attributes) { { timestamp: 123456 } }
|
14
|
+
end
|
15
|
+
|
16
|
+
%w(timestamp name tier queue).each do |attribute|
|
17
|
+
describe "#{attribute} attribute" do
|
18
|
+
it_behaves_like 'plain attribute' do
|
19
|
+
let(:attribute) { attribute }
|
20
|
+
let(:attribute_value) { 'asd' }
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
pending "fills entries with LeagueEntry objects"
|
26
|
+
end
|
27
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-lol
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Giovanni Intini
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-12-
|
11
|
+
date: 2013-12-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|