Class: Challonge::Match
- Inherits:
-
API
- Object
- ActiveResource::Base
- API
- Challonge::Match
show all
- Defined in:
- lib/challonge/match.rb
Overview
the only attributes that will save are: scores_csv, winner_id
Instance Method Summary
collapse
Methods inherited from API
key, key=, username, username=
Instance Method Details
#create ⇒ Object
27
|
# File 'lib/challonge/match.rb', line 27
def create; end
|
#destroy ⇒ Object
30
|
# File 'lib/challonge/match.rb', line 30
def destroy; end
|
#player1 ⇒ Object
14
15
16
|
# File 'lib/challonge/match.rb', line 14
def player1
_find_player(:player1_id)
end
|
#player2 ⇒ Object
18
19
20
|
# File 'lib/challonge/match.rb', line 18
def player2
_find_player(:player2_id)
end
|
#player_winner?(participant) ⇒ Boolean
22
23
24
|
# File 'lib/challonge/match.rb', line 22
def player_winner? (participant)
(participant.id != self.winner_id)
end
|
#tournament ⇒ Object
6
7
8
|
# File 'lib/challonge/match.rb', line 6
def tournament
Challonge::Tournament.find(self.prefix_options[:tournament_id])
end
|
#tournament=(tournament) ⇒ Object
10
11
12
|
# File 'lib/challonge/match.rb', line 10
def tournament=(tournament)
self.prefix_options[:tournament_id] = tournament.id
end
|