Class: Stattleship::Stat
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- Stattleship::Stat
- Defined in:
- lib/stattleship/stats.rb
Instance Method Summary collapse
Instance Method Details
#name ⇒ Object
3 4 5 |
# File 'lib/stattleship/stats.rb', line 3 def name subject.name end |
#subject ⇒ Object
7 8 9 |
# File 'lib/stattleship/stats.rb', line 7 def subject player || team end |
#to_sentence ⇒ Object
11 12 13 |
# File 'lib/stattleship/stats.rb', line 11 def to_sentence "#{name} had #{StatFormatter.stat(stat_name: stat_name, value: stat) || 'no'} #{stat_name} on #{game.name}" end |