Class: GPGME::IOCallbacks

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

Instance Method Summary collapse

Constructor Details

#initialize(io) ⇒ IOCallbacks

Returns a new instance of IOCallbacks.



544
545
546
# File 'lib/gpgme.rb', line 544

def initialize(io)
  @io = io
end

Instance Method Details

#read(hook, length) ⇒ Object



548
549
550
# File 'lib/gpgme.rb', line 548

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

#seek(hook, offset, whence) ⇒ Object



556
557
558
559
560
# File 'lib/gpgme.rb', line 556

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) ⇒ Object



552
553
554
# File 'lib/gpgme.rb', line 552

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