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
12 13 14 |
# File 'lib/ehbrs_ruby_utils/bga/game_statistics/whatsapp_formatter/player_title.rb', line 12 def result username_by_tables || player.name end |
#username_by_table(table) ⇒ String?
24 25 26 |
# File 'lib/ehbrs_ruby_utils/bga/game_statistics/whatsapp_formatter/player_title.rb', line 24 def username_by_table(table) table.player_by_id(player.id).if_present(&:name) end |
#username_by_tables ⇒ String?
17 18 19 20 |
# File 'lib/ehbrs_ruby_utils/bga/game_statistics/whatsapp_formatter/player_title.rb', line 17 def username_by_tables formatter.with_players_tables.lazy.map { |table| username_by_table(table) } .find(&:present?) end |