Class: SportsManager::Algorithms::Ordering::MultipleMatchesParticipant
- Defined in:
- lib/sports_manager/algorithms/ordering/multiple_matches_participant.rb
Instance Attribute Summary collapse
-
#tournament ⇒ Object
readonly
Returns the value of attribute tournament.
Class Method Summary collapse
-
.for(dependency:, problem: nil) ⇒ Object
rubocop:disable Lint/UnusedMethodArgument.
Instance Method Summary collapse
- #call(variables) ⇒ Object
-
#initialize(tournament) ⇒ MultipleMatchesParticipant
constructor
A new instance of MultipleMatchesParticipant.
Constructor Details
#initialize(tournament) ⇒ MultipleMatchesParticipant
Returns a new instance of MultipleMatchesParticipant.
13 14 15 |
# File 'lib/sports_manager/algorithms/ordering/multiple_matches_participant.rb', line 13 def initialize(tournament) @tournament = tournament end |
Instance Attribute Details
#tournament ⇒ Object (readonly)
Returns the value of attribute tournament.
7 8 9 |
# File 'lib/sports_manager/algorithms/ordering/multiple_matches_participant.rb', line 7 def tournament @tournament end |
Class Method Details
.for(dependency:, problem: nil) ⇒ Object
rubocop:disable Lint/UnusedMethodArgument
9 10 11 |
# File 'lib/sports_manager/algorithms/ordering/multiple_matches_participant.rb', line 9 def self.for(dependency:, problem: nil) # rubocop:disable Lint/UnusedMethodArgument new(dependency) end |
Instance Method Details
#call(variables) ⇒ Object
17 18 19 |
# File 'lib/sports_manager/algorithms/ordering/multiple_matches_participant.rb', line 17 def call(variables) variables.sort_by(&method(:sort)) end |