Class: Equalshares::TieBreaker::Extreme
- Inherits:
-
Object
- Object
- Equalshares::TieBreaker::Extreme
- Defined in:
- lib/equalshares/tie_breaker.rb
Overview
Keep the projects tied at the best value of some key.
Instance Method Summary collapse
Instance Method Details
#filter(remaining, ctx) ⇒ Object
35 36 37 38 |
# File 'lib/equalshares/tie_breaker.rb', line 35 def filter(remaining, ctx) best = remaining.map { |c| key(c, ctx) }.public_send(extreme) remaining.select { |c| key(c, ctx) == best } end |