Class: Munge::Function::Clean
- Inherits:
-
Object
- Object
- Munge::Function::Clean
- Defined in:
- lib/munge/function/clean.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(memory:, destination:) ⇒ Clean
constructor
A new instance of Clean.
Constructor Details
#initialize(memory:, destination:) ⇒ Clean
Returns a new instance of Clean.
4 5 6 7 |
# File 'lib/munge/function/clean.rb', line 4 def initialize(memory:, destination:) @memory = memory @destination = destination end |
Instance Method Details
#call ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/munge/function/clean.rb', line 9 def call orphans = @destination.tree - @memory.tree orphans.each do |orphan| @destination.rm(orphan) end end |