Module: EhbrsRubyUtils::Bga::Urls::InstanceMethods
- Included in:
- EhbrsRubyUtils::Bga::Urls
- Defined in:
- lib/ehbrs_ruby_utils/bga/urls.rb
Constant Summary collapse
- ROOT_URL =
'https://boardgamearena.com'
Instance Method Summary collapse
- #build_url(suffix) ⇒ Addressable::URI
- #player_game_in_progress_url(player_id) ⇒ Addressable::URI
- #player_game_stats_url(player_id) ⇒ Addressable::URI
- #root_url ⇒ Addressable::URI
- #table_url(table_id) ⇒ Addressable::URI
Instance Method Details
#build_url(suffix) ⇒ Addressable::URI
16 17 18 |
# File 'lib/ehbrs_ruby_utils/bga/urls.rb', line 16 def build_url(suffix) root_url + suffix end |
#player_game_in_progress_url(player_id) ⇒ Addressable::URI
22 23 24 |
# File 'lib/ehbrs_ruby_utils/bga/urls.rb', line 22 def player_game_in_progress_url(player_id) build_url("/gameinprogress?player=#{player_id}&all") end |
#player_game_stats_url(player_id) ⇒ Addressable::URI
28 29 30 |
# File 'lib/ehbrs_ruby_utils/bga/urls.rb', line 28 def player_game_stats_url(player_id) build_url("/gamestats?player=#{player_id}") end |
#root_url ⇒ Addressable::URI
33 34 35 |
# File 'lib/ehbrs_ruby_utils/bga/urls.rb', line 33 def root_url ROOT_URL.to_uri end |
#table_url(table_id) ⇒ Addressable::URI
38 39 40 |
# File 'lib/ehbrs_ruby_utils/bga/urls.rb', line 38 def table_url(table_id) build_url("/table?table=#{table_id}") end |