Class: CodeSunset::RemovalCandidateQuery
- Inherits:
-
Object
- Object
- CodeSunset::RemovalCandidateQuery
- Defined in:
- lib/code_sunset/removal_candidate_query.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(filters = {}) ⇒ RemovalCandidateQuery
constructor
A new instance of RemovalCandidateQuery.
Constructor Details
#initialize(filters = {}) ⇒ RemovalCandidateQuery
Returns a new instance of RemovalCandidateQuery.
3 4 5 |
# File 'lib/code_sunset/removal_candidate_query.rb', line 3 def initialize(filters = {}) @filters = filters end |
Instance Method Details
#call ⇒ Object
7 8 9 10 11 |
# File 'lib/code_sunset/removal_candidate_query.rb', line 7 def call CodeSunset::FeatureQuery.new(filters).call.select do |snapshot| %w[candidate_for_removal safe_to_remove].include?(snapshot.status) end.sort_by { |snapshot| [-snapshot.score.to_f, snapshot.feature.key] } end |