Class: NbaRb::Player::List
- Inherits:
-
Object
- Object
- NbaRb::Player::List
- Includes:
- Initializable, StatsHash, StatsRequest
- Defined in:
- lib/nba_rb/player/list.rb,
lib/nba_rb/player/player_list.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#league_id ⇒ Object
Returns the value of attribute league_id.
-
#only_current ⇒ Object
Returns the value of attribute only_current.
-
#season ⇒ Object
Returns the value of attribute season.
Instance Method Summary collapse
- #info ⇒ Object
-
#initialize(*args) ⇒ List
constructor
A new instance of List.
Methods included from StatsHash
Methods included from StatsRequest
Constructor Details
#initialize(*args) ⇒ List
Returns a new instance of List.
13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/nba_rb/player/list.rb', line 13 def initialize(*args) super(*args) @league_id ||= NbaRb::League.NBA @season ||= NbaRb::CURRENT_SEASON @only_current ||= 1 res = stats_request('commonallplayers', 'LeagueID' => league_id, 'Season' => season, 'IsOnlyCurrentSeason' => only_current) @data = res['resultSets'] end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
8 9 10 |
# File 'lib/nba_rb/player/list.rb', line 8 def data @data end |
#league_id ⇒ Object
Returns the value of attribute league_id.
8 9 10 |
# File 'lib/nba_rb/player/list.rb', line 8 def league_id @league_id end |
#only_current ⇒ Object
Returns the value of attribute only_current.
8 9 10 |
# File 'lib/nba_rb/player/list.rb', line 8 def only_current @only_current end |
#season ⇒ Object
Returns the value of attribute season.
8 9 10 |
# File 'lib/nba_rb/player/list.rb', line 8 def season @season end |
Instance Method Details
#info ⇒ Object
27 28 29 |
# File 'lib/nba_rb/player/list.rb', line 27 def info @data[0] end |