Class: Mayfly::File
- Inherits:
-
File
- Object
- File
- Mayfly::File
- Defined in:
- lib/mayfly/file.rb
Instance Method Summary collapse
- #close ⇒ Object
-
#initialize(file, close_callback = nil) ⇒ File
constructor
A new instance of File.
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
#close ⇒ Object
12 13 14 15 |
# File 'lib/mayfly/file.rb', line 12 def close super @close_callback.call if @close_callback != nil end |