Class: Inch::API::Suggest

Inherits:
Filter
  • Object
show all
Defined in:
lib/inch/api/suggest.rb

Instance Attribute Summary

Attributes inherited from Filter

#codebase

Instance Method Summary collapse

Constructor Details

#initialize(codebase, options) ⇒ Suggest

Returns a new instance of Suggest.



6
7
8
9
# File 'lib/inch/api/suggest.rb', line 6

def initialize(codebase, options)
  super
  @options = Options::Suggest.new(options)
end

Instance Method Details

#all_objectsArray

Returns all the objects that match @options.

Returns:

  • (Array)

    all the objects that match @options



27
28
29
# File 'lib/inch/api/suggest.rb', line 27

def all_objects
  relevant_objects
end

#filesObject



11
12
13
14
15
# File 'lib/inch/api/suggest.rb', line 11

def files
  list = files_sorted_by_importance
  how_many = @options.file_count || list.size
  list[0...how_many]
end

#grade_listsObject



17
18
19
# File 'lib/inch/api/suggest.rb', line 17

def grade_lists
  super(relevant_objects)
end

#objectsArray

Returns the @options.object_count objects the API suggests.

Returns:

  • (Array)

    the @options.object_count objects the API suggests



22
23
24
# File 'lib/inch/api/suggest.rb', line 22

def objects
  filter_objects_to_display
end