Sha256: c339346e812db042ada0f390d418d13447d5c8ee030e073f6d5c35287b077096

Contents?: true

Size: 578 Bytes

Versions: 7

Compression:

Stored size: 578 Bytes

Contents

# frozen_string_literal: true

require 'eac_ruby_utils/core_ext'

module EhbrsRubyUtils
  module Bga
    class TableWhatsappFormatter
      class FormatPlayer
        enable_method_class
        common_constructor :table_formatter, :player

        FIELD_SEPARATOR = ' - '

        def result
          %w[table_rank name score].map { |v| send(v) }.join(FIELD_SEPARATOR)
        end

        def table_rank
          "*#{player.rank}º*"
        end

        delegate :name, to: :player

        def score
          "⭐ #{player.score}"
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
ehbrs_ruby_utils-0.31.0 lib/ehbrs_ruby_utils/bga/table_whatsapp_formatter/format_player.rb
ehbrs_ruby_utils-0.30.0 lib/ehbrs_ruby_utils/bga/table_whatsapp_formatter/format_player.rb
ehbrs_ruby_utils-0.29.0 lib/ehbrs_ruby_utils/bga/table_whatsapp_formatter/format_player.rb
ehbrs_ruby_utils-0.28.0 lib/ehbrs_ruby_utils/bga/table_whatsapp_formatter/format_player.rb
ehbrs_ruby_utils-0.27.1 lib/ehbrs_ruby_utils/bga/table_whatsapp_formatter/format_player.rb
ehbrs_ruby_utils-0.27.0 lib/ehbrs_ruby_utils/bga/table_whatsapp_formatter/format_player.rb
ehbrs_ruby_utils-0.26.0 lib/ehbrs_ruby_utils/bga/table_whatsapp_formatter/format_player.rb