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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e525cd853cdbf18b2ce2db80ccd0e80a46af69facd46817334a0facf9edcb9b5
4
- data.tar.gz: 174cc7b70bef212dcbcd35649c62040bd101227e8eca35789ad4af6b00ab090f
3
+ metadata.gz: 9a5a7db33cdbdbed1120bcb2c84c792d9bb9d0f12b5c3df89a7bf3908fe17982
4
+ data.tar.gz: 3db1e5a940306dceb50a4766ddabbc6342e99711e83512e4002c60451857d755
5
5
  SHA512:
6
- metadata.gz: f6e91b50da4dfe5c46bf6e994356bcc9516b6cb6e2696f3b087d8a10ef0ae51371d3efbd6bdf9f1843f9e4ffb435929a12daefd66f6e4930d2ca7a78af238619
7
- data.tar.gz: 654d3be2486b24728b49123fc0f426b0495fb935e24a4f00dc07904398367a8fee82f11bbbb78d03b5603a68873f56577707f8e1debec5ceafcba0cd9c0cc9f5
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
@@ -1,4 +1,5 @@
1
1
  require 'espn_nba_fantasy/constants'
2
2
  require 'espn_nba_fantasy/player'
3
3
  require 'espn_nba_fantasy/league'
4
- require 'espn_nba_fantasy/team'
4
+ require 'espn_nba_fantasy/team'
5
+ require 'espn_nba_fantasy/user'
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.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