Class: Inch::API::Filter

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

Overview

Filters a codebase’s objects based on given options

Direct Known Subclasses

Get, List, Stats, Suggest

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(codebase, options) ⇒ Filter

Returns a new instance of Filter.



9
10
11
12
13
14
# File 'lib/inch/api/filter.rb', line 9

def initialize(codebase, options)
  @codebase = codebase
  codebase.objects.filter! Options::Filter(options)
  @objects = codebase.objects.to_a
  @grade_lists = @codebase.grade_lists
end

Instance Attribute Details

#codebaseObject (readonly)

Returns the value of attribute codebase.



5
6
7
# File 'lib/inch/api/filter.rb', line 5

def codebase
  @codebase
end

#grade_listsObject (readonly)

Returns the value of attribute grade_lists.



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

def grade_lists
  @grade_lists
end

#objectsObject (readonly)

Returns the value of attribute objects.



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

def objects
  @objects
end