Class: GPGME::IOCallbacks

Inherits:
Object
  • Object
show all
Defined in:
lib/gpgme/io_callbacks.rb

Instance Method Summary (collapse)

Constructor Details

- (IOCallbacks) initialize(io)



3
4
5
# File 'lib/gpgme/io_callbacks.rb', line 3

def initialize(io)
  @io = io
end

Instance Method Details

- (Object) read(hook, length)



7
8
9
# File 'lib/gpgme/io_callbacks.rb', line 7

def read(hook, length)
  @io.read(length)
end

- (Object) seek(hook, offset, whence)



15
16
17
18
19
# 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

- (Object) write(hook, buffer, length)



11
12
13
# File 'lib/gpgme/io_callbacks.rb', line 11

def write(hook, buffer, length)
  @io.write(buffer[0 .. length])
end