Method: MemoryIO::IO#write
- Defined in:
- lib/memory_io/io.rb
#write(objects, from: nil, as: nil) ⇒ void
This method returns an undefined value.
Write to stream.
162 163 164 165 166 167 168 |
# File 'lib/memory_io/io.rb', line 162 def write(objects, from: nil, as: nil) stream.pos = from if from as ||= objects.class if objects.class.ancestors.include?(MemoryIO::Types::Type) return stream.write(objects) if as.nil? conv = to_proc(as, :write) Array(objects).map { |o| conv.call(stream, o) } end |