Sha256: c36eb8331469d22f169d8e980ecf28ce22a14b38369173195096df64204b2949

Contents?: true

Size: 1.04 KB

Versions: 17

Compression:

Stored size: 1.04 KB

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_in_progress_url(player_id)
          build_url("/gameinprogress?player=#{player_id}&all")
        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

17 entries across 17 versions & 1 rubygems

Version Path
ehbrs_ruby_utils-0.44.3 lib/ehbrs_ruby_utils/bga/urls.rb
ehbrs_ruby_utils-0.44.2 lib/ehbrs_ruby_utils/bga/urls.rb
ehbrs_ruby_utils-0.44.1 lib/ehbrs_ruby_utils/bga/urls.rb
ehbrs_ruby_utils-0.44.0 lib/ehbrs_ruby_utils/bga/urls.rb
ehbrs_ruby_utils-0.41.1 lib/ehbrs_ruby_utils/bga/urls.rb
ehbrs_ruby_utils-0.41.0 lib/ehbrs_ruby_utils/bga/urls.rb
ehbrs_ruby_utils-0.40.0 lib/ehbrs_ruby_utils/bga/urls.rb
ehbrs_ruby_utils-0.39.0 lib/ehbrs_ruby_utils/bga/urls.rb
ehbrs_ruby_utils-0.38.0 lib/ehbrs_ruby_utils/bga/urls.rb
ehbrs_ruby_utils-0.37.0 lib/ehbrs_ruby_utils/bga/urls.rb
ehbrs_ruby_utils-0.36.1 lib/ehbrs_ruby_utils/bga/urls.rb
ehbrs_ruby_utils-0.36.0 lib/ehbrs_ruby_utils/bga/urls.rb
ehbrs_ruby_utils-0.35.0 lib/ehbrs_ruby_utils/bga/urls.rb
ehbrs_ruby_utils-0.33.0 lib/ehbrs_ruby_utils/bga/urls.rb
ehbrs_ruby_utils-0.32.0 lib/ehbrs_ruby_utils/bga/urls.rb
ehbrs_ruby_utils-0.31.0 lib/ehbrs_ruby_utils/bga/urls.rb
ehbrs_ruby_utils-0.30.0 lib/ehbrs_ruby_utils/bga/urls.rb