Class: Hashira::Smells::Census

Inherits:
Object
  • Object
show all
Defined in:
lib/hashira/smells/census.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(project, trees) ⇒ Census

Returns a new instance of Census.



6
7
8
9
10
# File 'lib/hashira/smells/census.rb', line 6

def initialize(project, trees)
  @project = project
  @trees = trees
  @ownership = Hashira::Smells::Ownership.new(trees.values)
end

Instance Attribute Details

#ownershipObject (readonly)

Returns the value of attribute ownership.



12
13
14
# File 'lib/hashira/smells/census.rb', line 12

def ownership
  @ownership
end

Instance Method Details

#typesObject



14
# File 'lib/hashira/smells/census.rb', line 14

def types = @trees.flat_map { |path, tree| harvest(@project.relative(path), tree) }