Class: Inch::Codebase::Proxy

Inherits:
Object
  • Object
show all
Defined in:
lib/inch/codebase/proxy.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(dir = Dir.pwd, paths = nil, excluded = nil) ⇒ Proxy

Returns a new instance of Proxy.



6
7
8
9
10
# File 'lib/inch/codebase/proxy.rb', line 6

def initialize(dir = Dir.pwd, paths = nil, excluded = nil)
  @base_dir = dir
  provider = CodeObject::Provider.parse(dir, paths, excluded)
  @objects = Codebase::Objects.new(provider.objects)
end

Instance Attribute Details

#objectsObject (readonly)

Returns the value of attribute objects.



4
5
6
# File 'lib/inch/codebase/proxy.rb', line 4

def objects
  @objects
end

Instance Method Details

#grade_listsObject



12
13
14
15
16
17
18
19
# File 'lib/inch/codebase/proxy.rb', line 12

def grade_lists
  lists = Evaluation.new_grade_lists
  lists.each do |range|
    list = objects.select { |o| range.scores.include?(o.score) }
    range.objects = Objects.sort_by_priority(list)
  end
  lists
end