Sha256: 398b87f4ae052790a00fac057207f22d7054cb2120f1a3860b8385969672f12c

Contents?: true

Size: 861 Bytes

Versions: 9

Compression:

Stored size: 861 Bytes

Contents

# frozen_string_literal: true

require 'aranha/selenium/session'
require 'eac_ruby_utils/core_ext'

module EhbrsRubyUtils
  module Bga
    module Urls
      common_concern

      module InstanceMethods
        ROOT_URL = 'https://boardgamearena.com'

        # @param suffix [String]
        # @return [Addressable::URI]
        def build_url(suffix)
          root_url + suffix
        end

        # @para player_id [Integer]
        # @return [Addressable::URI]
        def player_game_stats_url(player_id)
          build_url("/gamestats?player=#{player_id}")
        end

        # @return [Addressable::URI]
        def root_url
          ROOT_URL.to_uri
        end

        # @return [Addressable::URI]
        def table_url(table_id)
          build_url("/table?table=#{table_id}")
        end
      end

      extend InstanceMethods
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
ehbrs_ruby_utils-0.29.0 lib/ehbrs_ruby_utils/bga/urls.rb
ehbrs_ruby_utils-0.28.0 lib/ehbrs_ruby_utils/bga/urls.rb
ehbrs_ruby_utils-0.27.1 lib/ehbrs_ruby_utils/bga/urls.rb
ehbrs_ruby_utils-0.27.0 lib/ehbrs_ruby_utils/bga/urls.rb
ehbrs_ruby_utils-0.26.0 lib/ehbrs_ruby_utils/bga/urls.rb
ehbrs_ruby_utils-0.25.1 lib/ehbrs_ruby_utils/bga/urls.rb
ehbrs_ruby_utils-0.25.0 lib/ehbrs_ruby_utils/bga/urls.rb
ehbrs_ruby_utils-0.24.1 lib/ehbrs_ruby_utils/bga/urls.rb
ehbrs_ruby_utils-0.24.0 lib/ehbrs_ruby_utils/bga/urls.rb