Class: Pikuri::Finalizers::Closer

Inherits:
Struct
  • Object
show all
Defined in:
lib/pikuri/finalizers.rb

Overview

Adapts a teardown block to the #close protocol, so a block and a closeable object can share one registry.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#blockObject

Returns the value of attribute block

Returns:

  • (Object)

    the current value of block



52
53
54
# File 'lib/pikuri/finalizers.rb', line 52

def block
  @block
end

Instance Method Details

#closevoid

This method returns an undefined value.



54
55
56
# File 'lib/pikuri/finalizers.rb', line 54

def close
  block.call
end