Class: Omnizip::IO::Sink::PathSink

Inherits:
Sink
  • Object
show all
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

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

#closeObject



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