Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
instance method
Psych::Parser#skip_io_bom
skip_io_bom(io, bom)
ext/psych/lib/psych/parser.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.1.0-preview1/ext/psych/lib/psych/parser.rb, line 94
def skip_io_bom io, bom
begin
pos = io.pos
rescue SystemCallError, IOError
return # Not seekable; nothing has been consumed yet.
end
head = io.read(bom.bytesize)
io.seek(pos, IO::SEEK_SET) if head && head.b != bom
end
No documentation available