public Method

StringInput.seek( offset, whence = IO::SEEK_SET )

There's no documentation for this item.

Source Code

# File action_mailer/vendor/tmail-1.1.0/tmail/stringio.rb, line 89
def seek( offset, whence = IO::SEEK_SET )
  stream_check!
  case whence
  when IO::SEEK_SET
    @pos = offset
  when IO::SEEK_CUR
    @pos += offset
  when IO::SEEK_END
    @pos = @src.size - offset
  else
    raise ArgumentError, "unknown seek flag: #{whence}"
  end
  @pos = 0 if @pos < 0
  @pos = [@pos, @src.size + 1].min
  offset
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.