module Mongo::Grid::FSBucket::Stream
A stream that reads and writes files from/to the FSBucket
.
@since 2.1.0
Constants
- MODE_MAP
Mapping from mode to stream class.
@since 2.1.0
- READ_MODE
The symbol for opening a read stream.
@since 2.1.0
- WRITE_MODE
The symbol for opening a write stream.
@since 2.1.0
Public Instance Methods
get(fs, mode, options = {})
click to toggle source
Get a stream for reading/writing files from/to the FSBucket
.
@example Get a stream.
FSBucket::Stream.get(fs, FSBucket::READ_MODE, options)
@param [ FSBucket
] fs The GridFS bucket object. @param [ FSBucket::READ_MODE, FSBucket::WRITE_MODE ] mode The stream mode. @param [ Hash ] options The stream options.
@return [ Stream::Read
, Stream::Write
] The stream object.
@since 2.1.0
# File lib/mongo/grid/stream.rb, line 58 def get(fs, mode, options = {}) MODE_MAP[mode].new(fs, options) end