Class: Hashira::Duplication::Harvest
- Inherits:
-
Object
- Object
- Hashira::Duplication::Harvest
- Defined in:
- lib/hashira/duplication/harvest.rb
Constant Summary collapse
- WHOLE =
[Prism::DefNode, Prism::WhenNode, Prism::RescueNode].freeze
Instance Method Summary collapse
- #fragments ⇒ Object
-
#initialize(project, trees) ⇒ Harvest
constructor
A new instance of Harvest.
Constructor Details
#initialize(project, trees) ⇒ Harvest
Returns a new instance of Harvest.
8 9 10 11 |
# File 'lib/hashira/duplication/harvest.rb', line 8 def initialize(project, trees) @project = project @trees = trees end |
Instance Method Details
#fragments ⇒ Object
13 |
# File 'lib/hashira/duplication/harvest.rb', line 13 def fragments = @_fragments ||= @trees.flat_map { |path, tree| scan(@project.relative(path), tree) } |