Class: Hashira::Analysis::Definitions
- Inherits:
-
Object
- Object
- Hashira::Analysis::Definitions
- Includes:
- Enumerable
- Defined in:
- lib/hashira/analysis/definitions.rb
Instance Method Summary collapse
- #each ⇒ Object
-
#initialize(project, trees) ⇒ Definitions
constructor
A new instance of Definitions.
- #packages ⇒ Object
- #roots ⇒ Object
Constructor Details
#initialize(project, trees) ⇒ Definitions
Returns a new instance of Definitions.
6 7 8 9 |
# File 'lib/hashira/analysis/definitions.rb', line 6 def initialize(project, trees) @project = project @trees = trees end |
Instance Method Details
#each ⇒ Object
11 12 13 |
# File 'lib/hashira/analysis/definitions.rb', line 11 def each(&) @trees.each { |file, tree| scan(file, tree, &) } end |
#packages ⇒ Object
15 |
# File 'lib/hashira/analysis/definitions.rb', line 15 def packages = @trees.keys.map { @project.package(it) }.uniq |
#roots ⇒ Object
17 18 19 |
# File 'lib/hashira/analysis/definitions.rb', line 17 def roots @roots ||= @trees.each_value.with_object(Set.new) { |tree, set| survey(tree, set) } end |