class MemoryIO::IO

def write(objects, from: nil, as: nil)

Other tags:
    See: Types -

Returns:
  • (void) -

Parameters:
  • as (nil, Symbol, Proc) --
  • from (Integer) --
  • objects (Object, Array) --
    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