Class: EhbrsRubyUtils::Bga::GameStatistics::WhatsappFormatter::PlayerTitle
- Inherits:
-
Object
- Object
- EhbrsRubyUtils::Bga::GameStatistics::WhatsappFormatter::PlayerTitle
- Defined in:
- lib/ehbrs_ruby_utils/bga/game_statistics/whatsapp_formatter/player_title.rb
Instance Method Summary collapse
Instance Method Details
#result ⇒ String
14 15 16 |
# File 'lib/ehbrs_ruby_utils/bga/game_statistics/whatsapp_formatter/player_title.rb', line 14 def result username_by_tables || player.name end |
#username_by_table(table) ⇒ String?
26 27 28 |
# File 'lib/ehbrs_ruby_utils/bga/game_statistics/whatsapp_formatter/player_title.rb', line 26 def username_by_table(table) table.player_by_id(player.id).if_present(&:name) end |
#username_by_tables ⇒ String?
19 20 21 22 |
# File 'lib/ehbrs_ruby_utils/bga/game_statistics/whatsapp_formatter/player_title.rb', line 19 def username_by_tables formatter.with_players_tables.lazy.map { |table| username_by_table(table) } .find(&:present?) end |