stattleship-ruby 0.1.20 → 0.1.21

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: e41cef17c3cd474b302c74abd7f9b6d6fb92bc75
4
- data.tar.gz: d8962478313ef084954383c1ecd7eb35e30ab856
3
+ metadata.gz: 16188346bbcd22a47c2e66791f883577317bbd71
4
+ data.tar.gz: 8f979f332bf109ceecf7596f281b44762a9f8c5a
5
5
  SHA512:
6
- metadata.gz: 5143c933c07f984c740ecd5ed7af5ea057fa13718cc19f8f8e3d8a96b30f46463f0f4893891aeb2335e3344168d72aaf142b92999dfcea29a7bc8f9830039418
7
- data.tar.gz: 3b12b923e9701bbf5aa3a635fcd394059526b714ab1138ef6efc5a01bfc56abd587e443080e9c34d848df47e38713d0670ab6f92209b79961e8d1545d24ecc1b
6
+ metadata.gz: 9da199ee3bbca311f5a070e096731cba1ff48d16e741cfd6a30a349fdc2efba9117c1df47d058c442c32b119ac46efc3580c4bc0f1f3fc71dea19f2c658b0fb7
7
+ data.tar.gz: 46637e178323c660829ffd79a0cd8627c68b3d3ee41514d1f3cf0c82964ece197e4851284772a5f1cea3beb60408bffdbb0af4407c5db49c9aedb114f14d9e8b
data/CHANGELOG.md ADDED
@@ -0,0 +1,16 @@
1
+ # Changelog
2
+
3
+ ## 0.1.21
4
+
5
+ ### Added
6
+
7
+ Added `season_id` and `interval_type` parameter support for:
8
+
9
+ * `StatLeadersParams`
10
+ * `TopStatsParams`
11
+ * `TotalPlayerStatParams`
12
+
13
+ So that their sport flavors can call the API for specific seasons and intervals, such as
14
+ the 2015 MLB regular season vs the 2015 preseason.
15
+
16
+ ---
data/README.md CHANGED
@@ -22,7 +22,7 @@ gem install stattleship-ruby
22
22
  ## Usage
23
23
 
24
24
  ```
25
- gem 'stattleship-ruby', '~> 0.1.20'
25
+ gem 'stattleship-ruby', '~> 0.1.21'
26
26
  ```
27
27
 
28
28
  ### Build
@@ -34,7 +34,28 @@ gem build stattleship-ruby.gemspec
34
34
  ### Install
35
35
 
36
36
  ```
37
- gem install stattleship-ruby-0.1.20.gem
37
+ gem install stattleship-ruby-0.1.21.gem
38
+ ```
39
+ ## Prerequisites
40
+
41
+ You'll need
42
+
43
+ * Stattleship [API Access Token from https://www.stattleship.com](https://www.stattleship.com)
44
+
45
+ # Configuration
46
+
47
+ There are two ways to configure the gem.
48
+
49
+ ```
50
+ Stattleship.configure do |config|
51
+ config.api_token = YOUR_TOKEN
52
+ end
53
+ ```
54
+
55
+ or via a `.env`
56
+
57
+ ```
58
+ STATTLESHIP_ACCESS_TOKEN=YOUR_TOKEN
38
59
  ```
39
60
 
40
61
  ## API Documentation
data/examples/README.md CHANGED
@@ -30,7 +30,7 @@ You'll need
30
30
 
31
31
  * Stattleship API Access Token from https://www.stattleship.com
32
32
  * Set that in your `.env` file as `STATTLESHIP_ACCESS_TOKEN=your_token`
33
- * To run examples, that .env file should be the the `/examples` dir.
33
+ * To run examples, that .env file should be in the `/examples` dir.
34
34
  * Copy the `sample.env` file, insert your token and save as `examples/.env`
35
35
  * The `cd` to the `/examples` directory and `ruby <example>.rb` such that the .env loads
36
36
 
@@ -42,7 +42,7 @@ You'll need
42
42
 
43
43
  * [Football Game Logs](basketball_game_logs.rb)
44
44
  * Uses `FootballGameLogsParams` and makes a `FootballGameLogs` request
45
- * Use the `player_id`, `inteval_type` and `since` parameters to get Cam Newton's game logs for the past weeks by specifying the interval type (divisionplayoffs, conferencechampionships, etc)
45
+ * Use the `player_id`, `interval_type` and `since` parameters to get Cam Newton's game logs for the past weeks by specifying the interval type (divisionplayoffs, conferencechampionships, etc)
46
46
 
47
47
  * [Hockey Games](hockey_games.rb)
48
48
  * Uses `HockeyGamesParams` and makes a `HockeyGames` request
@@ -1,16 +1,17 @@
1
1
  module Stattleship
2
2
  module Params
3
3
  class StatLeadersParams < Stattleship::Params::QueryParams
4
- attr_accessor :place, :stat, :type
4
+ attr_accessor :interval_type, :place, :stat, :type
5
5
 
6
6
  private
7
7
 
8
8
  def params
9
- {
10
- 'stat' => stat,
11
- 'type' => type,
12
- 'place' => place
13
- }
9
+ super.merge({
10
+ 'interval_type' => interval_type,
11
+ 'stat' => stat,
12
+ 'type' => type,
13
+ 'place' => place,
14
+ })
14
15
  end
15
16
  end
16
17
  end
@@ -1,16 +1,17 @@
1
1
  module Stattleship
2
2
  module Params
3
3
  class TopStatsParams < Stattleship::Params::QueryParams
4
- attr_accessor :place, :stat, :type
4
+ attr_accessor :interval_type, :place, :stat, :type
5
5
 
6
6
  private
7
7
 
8
8
  def params
9
- {
10
- 'stat' => stat,
11
- 'type' => type,
12
- 'place' => place
13
- }
9
+ super.merge({
10
+ 'interval_type' => interval_type,
11
+ 'place' => place,
12
+ 'stat' => stat,
13
+ 'type' => type,
14
+ })
14
15
  end
15
16
  end
16
17
  end
@@ -1,16 +1,17 @@
1
1
  module Stattleship
2
2
  module Params
3
3
  class TotalPlayerStatParams < Stattleship::Params::QueryParams
4
- attr_accessor :player_id, :stat, :type
4
+ attr_accessor :interval_type, :player_id, :stat, :type
5
5
 
6
6
  private
7
7
 
8
8
  def params
9
- {
10
- 'player_id' => player_id,
11
- 'stat' => stat,
12
- 'type' => type,
13
- }
9
+ super.merge({
10
+ 'interval_type' => interval_type,
11
+ 'player_id' => player_id,
12
+ 'stat' => stat,
13
+ 'type' => type,
14
+ })
14
15
  end
15
16
  end
16
17
  end
@@ -1,5 +1,5 @@
1
1
  module Stattleship
2
2
  module Ruby
3
- VERSION = '0.1.20'.freeze
3
+ VERSION = '0.1.21'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stattleship-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.20
4
+ version: 0.1.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stattleship
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-05-15 00:00:00.000000000 Z
12
+ date: 2016-05-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: addressable
@@ -219,6 +219,7 @@ files:
219
219
  - ".rubocop.yml"
220
220
  - ".ruby-version"
221
221
  - ".travis.yml"
222
+ - CHANGELOG.md
222
223
  - CODE_OF_CONDUCT.md
223
224
  - Gemfile
224
225
  - LICENSE