class GPGME::IOCallbacks

Public Class Methods

new(io) click to toggle source
# File lib/gpgme/io_callbacks.rb, line 3
def initialize(io)
  @io = io
end

Public Instance Methods

read(hook, length) click to toggle source
# File lib/gpgme/io_callbacks.rb, line 7
def read(hook, length)
  @io.read(length)
end
seek(hook, offset, whence) click to toggle source
# File lib/gpgme/io_callbacks.rb, line 15
def seek(hook, offset, whence)
  return @io.pos if offset == 0 && whence == IO::SEEK_CUR
  @io.seek(offset, whence)
  @io.pos
end
write(hook, buffer, length) click to toggle source
# File lib/gpgme/io_callbacks.rb, line 11
def write(hook, buffer, length)
  @io.write(buffer[0 .. length])
end