Class: PHP::StringIOReader

Inherits:
StringIO
  • Object
show all
Defined in:
lib/php_serialize.rb

Instance Method Summary collapse

Instance Method Details

#read_until(char) ⇒ Object

Reads data from the buffer until char is found. The returned string will include char.



7
8
9
10
11
12
13
# File 'lib/php_serialize.rb', line 7

def read_until(char)
  val, cpos = '', pos
  if idx = string.index(char, cpos)
    val = read(idx - cpos + 1)
  end
  val
end