Class: Stattleship::BasketballGameLog

Inherits:
GameLog
  • Object
show all
Defined in:
lib/stattleship/basketball_game_logs.rb

Instance Method Summary collapse

Methods inherited from GameLog

#city, #league_abbreviation, #league_name, #opponent_full_name, #opponent_name, #player_name, #scoreline, #team_full_name, #team_name, #venue

Instance Method Details

#statsObject


3
4
5
6
7
8
9
10
11
12
13
# File 'lib/stattleship/basketball_game_logs.rb', line 3

def stats
  [
    "#{field_goals_made.to_i} FGM",
    "#{(field_goals_pct.to_f * 100).round(1)} FG%",
    "#{points.to_i} PTS",
    "#{rebounds_total.to_i} RBD",
    "#{assists.to_i} A",
    "#{steals.to_i} STL",
    "#{blocks.to_i} BLK"
  ]
end

#to_sentenceObject


15
16
17
# File 'lib/stattleship/basketball_game_logs.rb', line 15

def to_sentence
  "#{player_name} #{stats.join(', ')} (#{game.name})"
end