Class: EhbrsRubyUtils::Bga::Table
- Inherits:
-
Object
- Object
- EhbrsRubyUtils::Bga::Table
show all
- Includes:
- Urls
- Defined in:
- lib/ehbrs_ruby_utils/bga/table.rb,
lib/ehbrs_ruby_utils/bga/table/option.rb,
lib/ehbrs_ruby_utils/bga/table/player.rb,
lib/ehbrs_ruby_utils/bga/table/whatsapp_formatters.rb,
lib/ehbrs_ruby_utils/bga/table/whatsapp_formatters/base.rb,
lib/ehbrs_ruby_utils/bga/table/whatsapp_formatters/ending.rb,
lib/ehbrs_ruby_utils/bga/table/whatsapp_formatters/beginning.rb,
lib/ehbrs_ruby_utils/bga/table/whatsapp_formatters/base/format_option.rb,
lib/ehbrs_ruby_utils/bga/table/whatsapp_formatters/base/format_player.rb,
lib/ehbrs_ruby_utils/bga/table/whatsapp_formatters/ending/format_player.rb,
lib/ehbrs_ruby_utils/bga/table/whatsapp_formatters/beginning/format_player.rb
Defined Under Namespace
Modules: WhatsappFormatters
Classes: Option, Player
Constant Summary
collapse
- GAME_MODE_KEY =
'Modo de Jogo'
- GAME_MODE_FRIENDLY_VALUE =
'Modo Amigável'
- GAME_MODE_NORMAL_VALUE =
'Modo Normal'
- SET_ITEMS =
%i[options players].freeze
Urls::InstanceMethods::ROOT_URL
Instance Method Summary
collapse
#build_url, #player_game_in_progress_url, #player_game_stats_url, #root_url, #table_url
Instance Method Details
#game_conceded? ⇒ Boolean
38
39
40
|
# File 'lib/ehbrs_ruby_utils/bga/table.rb', line 38
def game_conceded?
game_conceded
end
|
#option_value(label) ⇒ String?
44
45
46
|
# File 'lib/ehbrs_ruby_utils/bga/table.rb', line 44
def option_value(label)
options.find { |o| o.label == label }.if_present(&:value)
end
|
50
51
52
|
# File 'lib/ehbrs_ruby_utils/bga/table.rb', line 50
def player_by_id(id)
players.find { |p| p.id.to_s == id.to_s }
end
|
#url ⇒ Addressable::URI
55
56
57
|
# File 'lib/ehbrs_ruby_utils/bga/table.rb', line 55
def url
table_url(id)
end
|