struct Redis::Parser
- Redis::Parser
- Struct
- Value
- Object
Defined in:
parser.crConstructors
-
.new(io : IO)
Initialize a parser to read from the given IO
Instance Method Summary
-
#read : Value
Read a
Redis::Value
from the parser'sIO
-
#read?
Reads a value from the
IO
, returningnil
on EOF.
Constructor Detail
Instance Method Detail
Read a Redis::Value
from the parser's IO
Example:
io = IO::Memory.new
io << "$3\r\n"
io << "foo\r\n"
io.rewind
Parser.new(io).read # => "foo"