Class: Hashira::Duplication::Extractor
- Inherits:
-
Object
- Object
- Hashira::Duplication::Extractor
- Defined in:
- lib/hashira/duplication/extractor.rb
Constant Summary collapse
- WHOLE =
[Prism::DefNode, Prism::WhenNode, Prism::RescueNode].freeze
Instance Attribute Summary collapse
-
#fragments ⇒ Object
readonly
Returns the value of attribute fragments.
Instance Method Summary collapse
-
#initialize(project, trees) ⇒ Extractor
constructor
A new instance of Extractor.
Constructor Details
#initialize(project, trees) ⇒ Extractor
Returns a new instance of Extractor.
10 11 12 13 |
# File 'lib/hashira/duplication/extractor.rb', line 10 def initialize(project, trees) @project = project @fragments = trees.flat_map { |path, tree| from_tree(@project.relative(path), tree) } end |
Instance Attribute Details
#fragments ⇒ Object (readonly)
Returns the value of attribute fragments.
15 16 17 |
# File 'lib/hashira/duplication/extractor.rb', line 15 def fragments @fragments end |