Class: Async::IO::Buffer
- Inherits:
-
String
- Object
- String
- Async::IO::Buffer
- Defined in:
- lib/async/io/buffer.rb
Constant Summary collapse
- BINARY =
Encoding::BINARY
Instance Method Summary collapse
- #<<(string) ⇒ Object (also: #concat)
-
#initialize ⇒ Buffer
constructor
A new instance of Buffer.
Constructor Details
#initialize ⇒ Buffer
Returns a new instance of Buffer.
28 29 30 31 32 |
# File 'lib/async/io/buffer.rb', line 28 def initialize super force_encoding(BINARY) end |
Instance Method Details
#<<(string) ⇒ Object Also known as: concat
34 35 36 37 38 39 40 41 42 |
# File 'lib/async/io/buffer.rb', line 34 def << string if string.encoding == BINARY super(string) else super(string.b) end return self end |