Method: Async::IO::Stream.open
- Defined in:
- lib/async/io/stream.rb
.open(path, mode = "r+", **options) ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/async/io/stream.rb', line 33 def self.open(path, mode = "r+", **) stream = self.new(File.open(path, mode), **) return stream unless block_given? begin yield stream ensure stream.close end end |