Class: Stattleship::HockeyGameLog

Inherits:
GameLog
  • Object
show all
Defined in:
lib/stattleship/hockey_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
# File 'lib/stattleship/hockey_game_logs.rb', line 3

def stats
  [
    "#{goals.to_i} G",
    "#{assists.to_i} A",
    "#{points.to_i} P",
    "#{shots.to_i} S",
    "#{hits.to_i} H",
    "#{goals_power_play.to_i} PPG"
  ]
end

#to_sentenceObject


14
15
16
# File 'lib/stattleship/hockey_game_logs.rb', line 14

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