Skip to content

Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →

instance method

IO::Buffer#empty?

() -> bool
empty? → true or false

Returns whether the buffer has zero size.

A buffer can be empty but have a non-null address, for example a zero-sized slice or a buffer created with ::for from an empty string. Therefore empty? does not imply null?.

See also #each_byte #get_string #each #get_value also in 4.0 · 3.4 · 3.3 · 3.2 · 3.1