Sha256: 70fbe26dabcd34e129cca0da317268bb3f978c0966c586acbe525b2c18ed322d

Contents?: true

Size: 711 Bytes

Versions: 24

Compression:

Stored size: 711 Bytes

Contents

# frozen_string_literal: true

require 'aranha/parsers/html/item_list'
require 'eac_ruby_utils/core_ext'

module EhbrsRubyUtils
  module Bga
    module Parsers
      class GameStats < ::Aranha::Parsers::Html::ItemList
        class Players < ::Aranha::Parsers::Html::ItemList
          ITEMS_XPATH = '//div[@class = "simple-score-entry"]'

          field :rank, :integer_optional, './div[@class = "rank"]'
          field :id, :integer, './div[@class = "name"]/a/@href'
          field :name, :string, './div[@class = "name"]/a/text()'
          field :score, :integer_optional, './div[@class = "score"]'

          def items_xpath
            ITEMS_XPATH
          end
        end
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
ehbrs_ruby_utils-0.26.0 lib/ehbrs_ruby_utils/bga/parsers/game_stats/players.rb
ehbrs_ruby_utils-0.25.1 lib/ehbrs_ruby_utils/bga/parsers/game_stats/players.rb
ehbrs_ruby_utils-0.25.0 lib/ehbrs_ruby_utils/bga/parsers/game_stats/players.rb
ehbrs_ruby_utils-0.24.1 lib/ehbrs_ruby_utils/bga/parsers/game_stats/players.rb