ruby-lol 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b867ffb05c47098f45beea30f1e091db52ac4fce
4
- data.tar.gz: fa6668a7f1777938f9487bbdbc6b2cebbb57645f
3
+ metadata.gz: 40594303990be0131e05065ee27214203ddc6c34
4
+ data.tar.gz: c145a0e4c8e88a5d078bd2899108646b48d63a31
5
5
  SHA512:
6
- metadata.gz: 560e480835130b3e3a50f58e996d5e1aba42b908786d830671b2959dfc038185a6249d8092fb212213ec915d9bbfcdfba2fb0f4a253fe8b06701da8010055e86
7
- data.tar.gz: a063f0f21d6ed47c5e9d64144b424b17cbe0ce29034c4cf399da46e8bd341bd670ba98b4080e624a158782e8846aac80aadc5b9fb2485ab50e6748ae95e9dc30
6
+ metadata.gz: 93d7b18857c428884b43d7eb71262c7211ca2c400f107f3ec3d3fbf66251374b433fed299bfceee92c04ce41e45d8f59ae5f87e659106aa1f2bea94ee1c3aa6f
7
+ data.tar.gz: a47eeabc90db1141c5222ffdd4b16d1fd2491127ee1503e22427c44853f2dc9ac7412032b643ba38fc1e0c46d35967319d179b63874f90b6114e6d81c2f83307
data/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # ruby-lol
2
- [![Coverage Status](https://coveralls.io/repos/mikamai/ruby-lol/badge.png)](https://coveralls.io/r/mikamai/ruby-lol) [![Build Status](https://travis-ci.org/mikamai/ruby-lol.png?branch=master)](https://travis-ci.org/mikamai/ruby-lol) [![Code Climate](https://codeclimate.com/repos/52a9908c56b102320a0166a4/badges/7e5d4ea4fe9e562f8e4d/gpa.png)](https://codeclimate.com/repos/52a9908c56b102320a0166a4/feed)
2
+ [![Gem Version](https://badge.fury.io/rb/ruby-lol.png)](http://badge.fury.io/rb/ruby-lol) [![Coverage Status](https://coveralls.io/repos/mikamai/ruby-lol/badge.png)](https://coveralls.io/r/mikamai/ruby-lol) [![Build Status](https://travis-ci.org/mikamai/ruby-lol.png?branch=master)](https://travis-ci.org/mikamai/ruby-lol) [![Code Climate](https://codeclimate.com/repos/52a9908c56b102320a0166a4/badges/7e5d4ea4fe9e562f8e4d/gpa.png)](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
- #<Lol::Client:0x007fd09d1abb00 @api_key="my_api_key", @region="euw">
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
- class League
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
@@ -1,3 +1,3 @@
1
1
  module Lol
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -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.1
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-12 00:00:00.000000000 Z
11
+ date: 2013-12-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler