Class: Mayfly::File

Inherits:
File
  • Object
show all
Defined in:
lib/mayfly/file.rb

Instance Method Summary collapse

Constructor Details

#initialize(file, close_callback = nil) ⇒ File

Returns a new instance of File.



7
8
9
10
# File 'lib/mayfly/file.rb', line 7

def initialize(file, close_callback = nil)
  super file
  @close_callback = close_callback      
end

Instance Method Details

#closeObject



12
13
14
15
# File 'lib/mayfly/file.rb', line 12

def close
  super
  @close_callback.call if @close_callback != nil
end