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.



126
127
128
# File 'lib/sudo/wrapper.rb', line 126

def initialize(h)
  @data = h
end

Instance Method Details

#call(*args) ⇒ Object

mimic proc-like behavior (walk like a duck)



131
132
133
# File 'lib/sudo/wrapper.rb', line 131

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