Class: Inch::API::Filter
- Inherits:
-
Object
- Object
- Inch::API::Filter
- Defined in:
- lib/inch/api/filter.rb
Overview
Filters a codebase’s objects based on given options
Instance Attribute Summary collapse
-
#codebase ⇒ Object
readonly
Returns the value of attribute codebase.
-
#objects ⇒ Object
readonly
Returns the value of attribute objects.
Instance Method Summary collapse
- #grade_lists(_objects = objects) ⇒ Object
-
#initialize(codebase, options) ⇒ Filter
constructor
A new instance of Filter.
Constructor Details
Instance Attribute Details
#codebase ⇒ Object (readonly)
Returns the value of attribute codebase.
5 6 7 |
# File 'lib/inch/api/filter.rb', line 5 def codebase @codebase end |
#objects ⇒ Object (readonly)
Returns the value of attribute objects.
6 7 8 |
# File 'lib/inch/api/filter.rb', line 6 def objects @objects end |
Instance Method Details
#grade_lists(_objects = objects) ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/inch/api/filter.rb', line 14 def grade_lists(_objects = objects) lists = Evaluation.new_grade_lists lists.each do |range| list = _objects.select { |o| range.scores.include?(o.score) } range.objects = Codebase::Objects.sort_by_priority(list) end lists end |