Class: Sudo::Wrapper::Finalizer

Inherits:
Object
  • Object
show all
Defined in:
lib/sudo/wrapper.rb

Overview

Inspired by Remover class in tmpfile.rb (Ruby std library). You don’t want to use this class directly.

Instance Method Summary collapse

Constructor Details

#initialize(h) ⇒ Finalizer

Returns a new instance of Finalizer.



112
113
114
# File 'lib/sudo/wrapper.rb', line 112

def initialize(h)
  @data = h
end

Instance Method Details

#call(*args) ⇒ Object

mimic proc-like behavior (walk like a duck)



117
118
119
# File 'lib/sudo/wrapper.rb', line 117

def call(*args)
  Sudo::Wrapper.cleanup! @data
end