Class: RatingChgkV2::Models::TeamModel

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/rating_chgk_v2/models/team_model.rb

Instance Attribute Summary

Attributes inherited from BaseModel

#endpoint

Instance Method Summary collapse

Methods inherited from BaseModel

inherited, #initialize, load

Constructor Details

This class inherits a constructor from RatingChgkV2::Models::BaseModel

Instance Method Details

#destroyObject



21
22
23
# File 'lib/rating_chgk_v2/models/team_model.rb', line 21

def destroy
  endpoint.do_delete
end

#seasons(params = {}) ⇒ Object



6
7
8
9
# File 'lib/rating_chgk_v2/models/team_model.rb', line 6

def seasons(params = {})
  endpoint.reinitialize new_params: params, add_query: :seasons
  RatingChgkV2::Collections::PlayerSeasonsCollection.load :do_get, endpoint
end

#tournaments(params = {}) ⇒ Object



11
12
13
14
# File 'lib/rating_chgk_v2/models/team_model.rb', line 11

def tournaments(params = {})
  endpoint.reinitialize new_params: params, add_query: :tournaments
  RatingChgkV2::Collections::TeamTournamentsCollection.load :do_get, endpoint
end

#update(params = {}) ⇒ Object



16
17
18
19
# File 'lib/rating_chgk_v2/models/team_model.rb', line 16

def update(params = {})
  endpoint.reinitialize new_params: params
  self.class.load :do_put, endpoint
end