Class: Stattleship::Leader
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- Stattleship::Leader
- Defined in:
- lib/stattleship/stat_leaders.rb
Instance Method Summary collapse
Instance Method Details
#format_stat(value) ⇒ Object
13 14 15 |
# File 'lib/stattleship/stat_leaders.rb', line 13 def format_stat(value) StatFormatter.stat(stat_name: stat_name, value: stat) end |
#lowercase_stat ⇒ Object
17 18 19 20 21 |
# File 'lib/stattleship/stat_leaders.rb', line 17 def lowercase_stat if humanized_stat humanized_stat.downcase end end |
#player_name ⇒ Object
3 4 5 6 7 |
# File 'lib/stattleship/stat_leaders.rb', line 3 def player_name if player player.name end end |
#to_sentence ⇒ Object
9 10 11 |
# File 'lib/stattleship/stat_leaders.rb', line 9 def to_sentence "#{player.name} is in #{place.ordinalize} place with #{format_stat(stat)} #{lowercase_stat}" end |