Class: ChessApi::TitledPlayerResource

Inherits:
Resource
  • Object
show all
Includes:
InputHelpers
Defined in:
lib/chess_api/resources/titled_players.rb

Instance Attribute Summary

Attributes inherited from Resource

#client

Instance Method Summary collapse

Methods included from InputHelpers

#downcased_username, #upcased_title_abbreviation

Methods inherited from Resource

#initialize

Constructor Details

This class inherits a constructor from ChessApi::Resource

Instance Method Details

#with_title(title_abbreviation:) ⇒ Object



5
6
7
8
9
10
11
12
13
# File 'lib/chess_api/resources/titled_players.rb', line 5

def with_title(title_abbreviation:)
  @title_abbreviation = title_abbreviation

  Collection.from_response(
    get_request("titled/#{upcased_title_abbreviation}"),
    key: "players",
    type: ChessApi::TitledPlayer
  )
end