Class: FormatParser::EXIFParser::IOExt
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- FormatParser::EXIFParser::IOExt
- Defined in:
- lib/parsers/exif_parser.rb
Overview
EXIFR kindly requests the presence of a few more methods than what our IOConstraint is willing to provide, but they can be derived from the available ones
Instance Method Summary collapse
- #readbyte ⇒ Object (also: #getbyte)
- #seek(n, seek_mode = IO::SEEK_SET) ⇒ Object
Instance Method Details
#readbyte ⇒ Object Also known as: getbyte
20 21 22 23 24 |
# File 'lib/parsers/exif_parser.rb', line 20 def readbyte if byte = read(1) byte.unpack('C').first end end |
#seek(n, seek_mode = IO::SEEK_SET) ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/parsers/exif_parser.rb', line 26 def seek(n, seek_mode = IO::SEEK_SET) io = __getobj__ case seek_mode when IO::SEEK_SET io.seek(n) when IO::SEEK_CUR io.seek(io.pos + n) when IO::SEEK_END io.seek(io.size + n) else raise Errno::EINVAL end end |