Class: ChessApi::PlayerResource
- Includes:
- InputHelpers
- Defined in:
- lib/chess_api/resources/players.rb
Defined Under Namespace
Modules: OnlineStatus
Instance Attribute Summary
Attributes inherited from Resource
Instance Method Summary collapse
Methods included from InputHelpers
#downcased_username, #upcased_title_abbreviation
Methods inherited from Resource
Constructor Details
This class inherits a constructor from ChessApi::Resource
Instance Method Details
#clubs(username:) ⇒ Object
25 26 27 28 29 30 31 32 33 |
# File 'lib/chess_api/resources/players.rb', line 25 def clubs(username:) @username = username ChessApi::Collection.from_response( get_request("player/#{downcased_username}/clubs"), key: "clubs", type: ChessApi::Club ) end |
#online_status(username:) ⇒ Object
18 19 20 21 22 23 |
# File 'lib/chess_api/resources/players.rb', line 18 def online_status(username:) @username = username is_online = get_request("player/#{downcased_username}/is-online").body["online"] is_online ? OnlineStatus::ONLINE : OnlineStatus::OFFLINE end |