Sha256: 2b2d347a99c05e443b86ffd5e56e75411830109fc6ab74909f760c07a6efa98e

Contents?: true

Size: 435 Bytes

Versions: 12

Compression:

Stored size: 435 Bytes

Contents

# frozen_string_literal: true

# Released under the MIT License.
# Copyright, 2018-2023, by Samuel Williams.

module Async
	module IO
		class Buffer < String
			BINARY = Encoding::BINARY
			
			def initialize
				super
				
				force_encoding(BINARY)
			end
			
			def << string
				if string.encoding == BINARY
					super(string)
				else
					super(string.b)
				end
				
				return self
			end
			
			alias concat <<
		end
	end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
async-io-1.43.2 lib/async/io/buffer.rb
async-io-1.43.1 lib/async/io/buffer.rb
async-io-1.43.0 lib/async/io/buffer.rb
async-io-1.42.1 lib/async/io/buffer.rb
async-io-1.42.0 lib/async/io/buffer.rb
async-io-1.41.0 lib/async/io/buffer.rb
async-io-1.39.0 lib/async/io/buffer.rb
async-io-1.38.1 lib/async/io/buffer.rb
async-io-1.38.0 lib/async/io/buffer.rb
async-io-1.37.0 lib/async/io/buffer.rb
async-io-1.36.1 lib/async/io/buffer.rb
async-io-1.36.0 lib/async/io/buffer.rb