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.
122 123 124 125 126 |
# File 'lib/omnizip/io/source.rb', line 122 def initialize(path) super(nil) @path = path @file = nil end |
Instance Method Details
#close ⇒ Object
132 |
# File 'lib/omnizip/io/source.rb', line 132 def close; end |
#write(data) ⇒ Object
128 129 130 |
# File 'lib/omnizip/io/source.rb', line 128 def write(data) File.binwrite(@path, data) end |