Class: Stattleship::BaseballTeamGameLog

Inherits:
TeamGameLog
  • Object
show all
Defined in:
lib/stattleship/baseball_team_game_logs.rb

Instance Method Summary collapse

Methods inherited from TeamGameLog

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

Instance Method Details

#statsObject


3
4
5
6
7
8
9
10
# File 'lib/stattleship/baseball_team_game_logs.rb', line 3

def stats
  [
    "#{hits.to_i} H",
    "#{runs.to_i} R",
    "#{runs_batted_in.to_i} RBI",
    "#{errors_made} E"
  ]
end

#to_sentenceObject


12
13
14
# File 'lib/stattleship/baseball_team_game_logs.rb', line 12

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