Support for the Ruby 2.1 series ended on March 31 2017. See here for details.

In Files

  • rubygems/util/stringio.rb

Parent

Class/Module Index [+]

Quicksearch

Gem::StringSource

Public Class Methods

new(str) click to toggle source
 
               # File rubygems/util/stringio.rb, line 19
def initialize(str)
  @string = str.dup
end
            

Public Instance Methods

read(count=nil) click to toggle source
 
               # File rubygems/util/stringio.rb, line 23
def read(count=nil)
  if count
    @string.slice!(0,count)
  else
    s = @string
    @string = ""
    s
  end
end
            
Also aliased as: readpartial
readpartial(count=nil) click to toggle source
Alias for: read