espn_nba_fantasy 1.0.0 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/espn_nba_fantasy/league.rb +1 -1
- data/lib/espn_nba_fantasy/user.rb +33 -0
- data/lib/espn_nba_fantasy.rb +2 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9a5a7db33cdbdbed1120bcb2c84c792d9bb9d0f12b5c3df89a7bf3908fe17982
|
4
|
+
data.tar.gz: 3db1e5a940306dceb50a4766ddabbc6342e99711e83512e4002c60451857d755
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d8c24b236a62ed59bd4447e0e6818bf809b904a622e6dcf23974e982488b1264470a4dc8a915b7be8176d6cd0f94097e339cd3e2f1411fe4da75be3c4af0a5ce
|
7
|
+
data.tar.gz: f9e02df387173b34b5b3b75257516e251aaafe37bc70d86e43f44d092312c8bf5e1e0018c17f36e2355c28191bc67946311d9a6c72c70d7e16d38ff39f2eb681
|
@@ -22,7 +22,7 @@ module ESPNNBAFantasy
|
|
22
22
|
@users = make_user_objects
|
23
23
|
@stat_data = make_stat_data
|
24
24
|
@league_id = @data['id']
|
25
|
-
@name = @data['name']
|
25
|
+
@name = @data['settings']['name']
|
26
26
|
@current_start_year = @data['seasonId']
|
27
27
|
@current_end_year = @current_start_year + 1
|
28
28
|
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
module ESPNNBAFantasy
|
2
|
+
class User
|
3
|
+
|
4
|
+
attr_accessor :display_name, :first_name, :last_name, :fantasy_id,
|
5
|
+
:teams, :league, :add_team
|
6
|
+
|
7
|
+
#basic initialization with the various attributes
|
8
|
+
|
9
|
+
def initialize(obj, league)
|
10
|
+
@display_name = obj['displayName']
|
11
|
+
@first_name = obj['firstName']
|
12
|
+
@last_name = obj['lastName']
|
13
|
+
@fantasy_id = obj['id']
|
14
|
+
@teams = []
|
15
|
+
@league = league
|
16
|
+
end
|
17
|
+
|
18
|
+
#method that lets you input who you're trading (Array of names), who you're receiving (Array of names),
|
19
|
+
#and what team you're trading with (String).
|
20
|
+
|
21
|
+
#returns data including the players trading away and receiving, your stats before and after the trade, and your
|
22
|
+
#change in stats for each category
|
23
|
+
|
24
|
+
def to_s
|
25
|
+
"User Name: #{first_name} #{last_name} | Teams: #{teams.map(&:name)}"
|
26
|
+
end
|
27
|
+
|
28
|
+
def add_team(team)
|
29
|
+
@teams << team
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
33
|
+
end
|
data/lib/espn_nba_fantasy.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: espn_nba_fantasy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Usborn Ocampo
|
@@ -94,6 +94,7 @@ files:
|
|
94
94
|
- lib/espn_nba_fantasy/player.rb
|
95
95
|
- lib/espn_nba_fantasy/player_finder.rb
|
96
96
|
- lib/espn_nba_fantasy/team.rb
|
97
|
+
- lib/espn_nba_fantasy/user.rb
|
97
98
|
homepage: https://rubygems.org/gems/espn_nba_fantasy
|
98
99
|
licenses:
|
99
100
|
- MIT
|