|
Server : LiteSpeed System : Linux server51.dnsbootclub.com 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64 User : nandedex ( 1060) PHP Version : 8.1.33 Disable Function : NONE Directory : /opt/alt/ruby34/share/ruby/prism/polyfill/ |
# frozen_string_literal: true
# Polyfill for String#unpack1 with the offset parameter. Not all Ruby engines
# have Method#parameters implemented, so we check the arity instead if
# necessary.
if (unpack1 = String.instance_method(:unpack1)).respond_to?(:parameters) ? unpack1.parameters.none? { |_, name| name == :offset } : (unpack1.arity == 1)
String.prepend(
Module.new {
def unpack1(format, offset: 0) # :nodoc:
offset == 0 ? super(format) : self[offset..].unpack1(format) # steep:ignore
end
}
)
end