class Stattleship::TotalTeamStat

Public Class Methods

fetch(path:, params:) click to toggle source
Calls superclass method Stattleship::Endpoint::fetch
# File lib/stattleship/total_team_stat.rb, line 17
def self.fetch(path:, params:)
  super.first
end

Public Instance Methods

lowercase_stat() click to toggle source
# File lib/stattleship/total_team_stat.rb, line 11
def lowercase_stat
  if humanized_stat
    humanized_stat.downcase
  end
end
populate() click to toggle source
# File lib/stattleship/total_team_stat.rb, line 21
def populate
  populate_teams(total_team_stat)
  populate_season(total_team_stat)

  total_team_stat
end
to_sentence() click to toggle source
# File lib/stattleship/total_team_stat.rb, line 3
def to_sentence
  if season_name.nil?
    "The #{team.full_name} have #{StatFormatter.stat(stat_name: stat, value: total)} #{lowercase_stat}"
  else
    "The #{team.full_name} had #{StatFormatter.stat(stat_name: stat, value: total)} #{lowercase_stat} in the #{season_name} season"
  end
end