class Olympic::Bracket::Base
A basic bracket. This defines the basic API that all brackets should have. In order for a bracket to be compatible with Olympic
, only these things need to be implemented.
Public Class Methods
new(tournament, teams)
click to toggle source
Initialize the bracket.
@param tournament [Olympic::Tournament] @param teams [Array<Olympic::Team>]
# File lib/olympic/bracket/base.rb, line 14 def initialize(tournament, teams) @tournament = tournament @teams = teams end
Private Instance Methods
_not_implemented_error(name)
click to toggle source
Raises an error stating that the given method wasn't implemented. This is the default action the API methods on this class takes; a subclass should redefine the methods to perform an action.
@note This should not be used outside of the base class. If
A `NotImplementedError` is to be raised outside of the base class, it should be raised with `raise`.
@raise [NotImplementError] on call. @return [void]
# File lib/olympic/bracket/base.rb, line 81 def _not_implemented_error(name) raise NotImplementedError, "`#{name}` is not implemented " \ "on `#{self.class}`" end