Class: Omnizip::IO::Sink::PathSink
- Inherits:
-
Sink
- Object
- Sink
- Omnizip::IO::Sink::PathSink
- Defined in:
- lib/omnizip/io/source.rb
Overview
File-path sink: opens the file for binary write on #write and closes after.
Instance Method Summary collapse
- #close ⇒ Object
-
#initialize(path) ⇒ PathSink
constructor
A new instance of PathSink.
- #write(data) ⇒ Object
Constructor Details
#initialize(path) ⇒ PathSink
Returns a new instance of PathSink.
129 130 131 132 133 |
# File 'lib/omnizip/io/source.rb', line 129 def initialize(path) super(nil) @path = path @file = nil end |
Instance Method Details
#close ⇒ Object
139 |
# File 'lib/omnizip/io/source.rb', line 139 def close; end |
#write(data) ⇒ Object
135 136 137 |
# File 'lib/omnizip/io/source.rb', line 135 def write(data) File.binwrite(@path, data) end |