Class: ChgkRating::Models::Player
- Inherits:
-
Base
- Object
- ChgkObject
- Base
- ChgkRating::Models::Player
- Defined in:
- lib/chgk_rating/models/player.rb
Constant Summary
Constants included from Connection
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#rating(release_id) ⇒ ChgkRating::Models::PlayerRating
Returns rating for the current Player in a given release.
-
#ratings ⇒ ChgkRating::Collection::PlayerRatings
Returns an array-like ratings collection for the current Player.
-
#tournaments(season_id = nil) ⇒ ChgkRating::Collection::PlayerTournaments
Returns a collection of Tournaments that the current player participated at based on the given criteria.
Methods inherited from Base
attribute_mapping, #eager_load!, inherited, #initialize, no_eager_loading!, no_lazy_support!, #to_h
Methods included from Request
Methods included from Connection
Methods inherited from ChgkObject
#build_model, #extract_id_from
Constructor Details
This class inherits a constructor from ChgkRating::Models::Base
Instance Method Details
#rating(release_id) ⇒ ChgkRating::Models::PlayerRating
Returns rating for the current Player in a given release
10 11 12 |
# File 'lib/chgk_rating/models/player.rb', line 10 def (release_id) ChgkRating::Models::PlayerRating.new release_id, player: self end |
#ratings ⇒ ChgkRating::Collection::PlayerRatings
Returns an array-like ratings collection for the current Player.
17 18 19 |
# File 'lib/chgk_rating/models/player.rb', line 17 def ChgkRating::Collections::PlayerRatings.new player: self end |
#tournaments(season_id = nil) ⇒ ChgkRating::Collection::PlayerTournaments
Returns a collection of Tournaments that the current player participated at based on the given criteria
27 28 29 |
# File 'lib/chgk_rating/models/player.rb', line 27 def tournaments(season_id = nil) ChgkRating::Collections::PlayerTournaments.new player: self, season_id: season_id end |