espn_nba_fantasy 1.0.1 → 1.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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/espn_nba_fantasy/user.rb +33 -0
  3. metadata +2 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3d4898b81c9edbc42139672ca839a319aca196c3afd9865908d6c362621606e0
4
- data.tar.gz: 81c41dc293744104151737bd4decc1ae8fb0e934d101c0528f241a6fac3530aa
3
+ metadata.gz: 9a5a7db33cdbdbed1120bcb2c84c792d9bb9d0f12b5c3df89a7bf3908fe17982
4
+ data.tar.gz: 3db1e5a940306dceb50a4766ddabbc6342e99711e83512e4002c60451857d755
5
5
  SHA512:
6
- metadata.gz: ff5605ac01b73f4c170d082c9e7fcb891bb973a5bd3f09788c2c8a861d602e6a1e1084d3cc62dea323bd3339c7e35675d5b8609549aac34ae0738f2d735505ff
7
- data.tar.gz: 889ecb3e03e5d08ec7fa0757f15835556bb04bb999d76eb1908a7a30d1fe5c489e4ecfc9b3a1aee391b6ebb2888e74fd2817454fc503ead0e9d6d6f8f893bde3
6
+ metadata.gz: d8c24b236a62ed59bd4447e0e6818bf809b904a622e6dcf23974e982488b1264470a4dc8a915b7be8176d6cd0f94097e339cd3e2f1411fe4da75be3c4af0a5ce
7
+ data.tar.gz: f9e02df387173b34b5b3b75257516e251aaafe37bc70d86e43f44d092312c8bf5e1e0018c17f36e2355c28191bc67946311d9a6c72c70d7e16d38ff39f2eb681
@@ -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
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.1
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