Class: NbaRb::Player::OpponentSplits

Inherits:
PlayerDashboard
  • Object
show all
Defined in:
lib/nba_rb/player/opponent_splits.rb,
lib/nba_rb/player/player_opponent_splits.rb

Instance Method Summary collapse

Instance Method Details

#by_conferenceObject



6
7
8
# File 'lib/nba_rb/player/opponent_splits.rb', line 6

def by_conference
  create_stats_hash(@data[1])
end

#by_divisionObject



18
19
20
# File 'lib/nba_rb/player/opponent_splits.rb', line 18

def by_division
  create_stats_hash(@data[2])
end

#by_opponentObject



28
29
30
# File 'lib/nba_rb/player/opponent_splits.rb', line 28

def by_opponent
  create_stats_hash(@data[3])
end

#vs_division(division) ⇒ Object



22
23
24
25
26
# File 'lib/nba_rb/player/opponent_splits.rb', line 22

def vs_division(division)
  by_division.each do |hash|
    return hash if hash['GROUP_VALUE'].downcase.include? division.downcase
  end
end

#vs_eastObject



10
11
12
# File 'lib/nba_rb/player/opponent_splits.rb', line 10

def vs_east
  by_conference[0]
end

#vs_team(team) ⇒ Object



32
33
34
35
36
# File 'lib/nba_rb/player/opponent_splits.rb', line 32

def vs_team(team)
  by_opponent.each do |hash|
    return hash if hash['GROUP_VALUE'].downcase.include? team.downcase
  end
end

#vs_westObject



14
15
16
# File 'lib/nba_rb/player/opponent_splits.rb', line 14

def vs_west
  by_conference[1]
end