Class: KillerQueenSceneScoring::Match
- Inherits:
-
Object
- Object
- KillerQueenSceneScoring::Match
- Defined in:
- lib/killer_queen_scene_scoring/match.rb
Instance Attribute Summary collapse
-
#points ⇒ Object
readonly
Returns the value of attribute points.
Instance Method Summary collapse
-
#has_team?(team_id) ⇒ Boolean
Returns whether the team with the Challonge ID ‘team_id` is in this match.
-
#initialize(challonge_obj, match_values) ⇒ Match
constructor
‘challonge_obj` is the Challonge data for this match.
Constructor Details
#initialize(challonge_obj, match_values) ⇒ Match
‘challonge_obj` is the Challonge data for this match. `match_values` is the array from the config file that holds how many points are awarded to the teams in that match.
11 12 13 14 15 16 17 |
# File 'lib/killer_queen_scene_scoring/match.rb', line 11 def initialize(challonge_obj, match_values) @team1_id = challonge_obj[:player1_id] @team2_id = challonge_obj[:player2_id] play_order = challonge_obj[:suggested_play_order] @points = match_values[play_order - 1] end |
Instance Attribute Details
#points ⇒ Object (readonly)
Returns the value of attribute points.
6 7 8 |
# File 'lib/killer_queen_scene_scoring/match.rb', line 6 def points @points end |
Instance Method Details
#has_team?(team_id) ⇒ Boolean
Returns whether the team with the Challonge ID ‘team_id` is in this match.
20 21 22 |
# File 'lib/killer_queen_scene_scoring/match.rb', line 20 def has_team?(team_id) @team1_id == team_id || @team2_id == team_id end |