Class: Stattleship::TopStat

Inherits:
OpenStruct
  • Object
show all
Defined in:
lib/stattleship/top_stats.rb

Instance Method Summary collapse

Instance Method Details

#format_stat(value) ⇒ Object



7
8
9
# File 'lib/stattleship/top_stats.rb', line 7

def format_stat(value)
  StatFormatter.stat(stat_name: stat_name, value: stat)
end

#to_sentenceObject



3
4
5
# File 'lib/stattleship/top_stats.rb', line 3

def to_sentence
  "#{player.name} had #{format_stat(stat)} #{stat_name} in #{game.name} for the #{place.ordinalize} best performance"
end