Class: EhbrsRubyUtils::Bga::Table::WhatsappFormatters::Base
- Inherits:
-
Object
- Object
- EhbrsRubyUtils::Bga::Table::WhatsappFormatters::Base
show all
- Includes:
- WhatsappFormatter
- Defined in:
- lib/ehbrs_ruby_utils/bga/table/whatsapp_formatters/base.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
Defined Under Namespace
Classes: FormatOption, FormatPlayer
Constant Summary
collapse
''
- ROOT_ITENS =
{
'Jogo' => :game_name,
'Criada em' => :creation_time,
'Duração' => :estimated_duration,
'Endereço' => :url
}.freeze
WhatsappFormatter::LINE_SEPARATOR, WhatsappFormatter::OPTION_SEPARATOR, WhatsappFormatter::SECTION_SEPARATOR
Instance Method Summary
collapse
#content_to_s, #game, #image_local_path, #options_to_s, #section_to_s, #title_icon, #title_to_s, #to_s
Instance Method Details
#options ⇒ Object
54
55
56
|
# File 'lib/ehbrs_ruby_utils/bga/table/whatsapp_formatters/base.rb', line 54
def options
table.options.map { |player| format_option(player) }
end
|
#players ⇒ Object
50
51
52
|
# File 'lib/ehbrs_ruby_utils/bga/table/whatsapp_formatters/base.rb', line 50
def players
table.players.map { |player| format_player(player) }
end
|
41
42
43
|
# File 'lib/ehbrs_ruby_utils/bga/table/whatsapp_formatters/base.rb', line 41
def
PLAYERS_EXTRA
end
|
#players_to_s ⇒ String
46
47
48
|
# File 'lib/ehbrs_ruby_utils/bga/table/whatsapp_formatters/base.rb', line 46
def players_to_s
+ players.join("\n")
end
|
#root_items ⇒ Hash
36
37
38
|
# File 'lib/ehbrs_ruby_utils/bga/table/whatsapp_formatters/base.rb', line 36
def root_items
ROOT_ITENS.transform_values { |v| table.send(v) }
end
|
#sections ⇒ Hash<String, String>
Returns “title” => “content”.
27
28
29
30
31
32
33
|
# File 'lib/ehbrs_ruby_utils/bga/table/whatsapp_formatters/base.rb', line 27
def sections
{
root_items_title => root_items,
players_title => players_to_s,
'Opções' => options
}
end
|