Class: GPGME::IOCallbacks
- Inherits:
-
Object
- Object
- GPGME::IOCallbacks
- Defined in:
- lib/gpgme.rb
Instance Method Summary collapse
-
#initialize(io) ⇒ IOCallbacks
constructor
A new instance of IOCallbacks.
- #read(hook, length) ⇒ Object
- #seek(hook, offset, whence) ⇒ Object
- #write(hook, buffer, length) ⇒ Object
Constructor Details
#initialize(io) ⇒ IOCallbacks
Returns a new instance of IOCallbacks.
554 555 556 |
# File 'lib/gpgme.rb', line 554 def initialize(io) @io = io end |
Instance Method Details
#read(hook, length) ⇒ Object
558 559 560 |
# File 'lib/gpgme.rb', line 558 def read(hook, length) @io.read(length) end |
#seek(hook, offset, whence) ⇒ Object
566 567 568 569 570 |
# File 'lib/gpgme.rb', line 566 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
562 563 564 |
# File 'lib/gpgme.rb', line 562 def write(hook, buffer, length) @io.write(buffer[0 .. length]) end |