Class: Indis::BinaryFormat::Format
- Inherits:
-
Object
- Object
- Indis::BinaryFormat::Format
- Defined in:
- lib/indis-core/binary_format.rb
Overview
Base class for any binary format.
Class Method Summary collapse
-
.magic ⇒ Fixnum
abstract
Magic bytes that are checked against the first bytes in binary.
-
.name ⇒ String
abstract
Human-readable format name.
Instance Method Summary collapse
-
#initialize(target, io) ⇒ Format
constructor
Basic constructor takes care of storing the target and io stream.
Constructor Details
#initialize(target, io) ⇒ Format
Basic constructor takes care of storing the target and io stream.
40 41 42 43 |
# File 'lib/indis-core/binary_format.rb', line 40 def initialize(target, io) @target = target @io = io end |
Class Method Details
.magic ⇒ Fixnum
This method is abstract.
Returns the format magic bytes.
Returns Magic bytes that are checked against the first bytes in binary.
48 49 50 |
# File 'lib/indis-core/binary_format.rb', line 48 def self.magic raise RuntimeError end |
.name ⇒ String
This method is abstract.
Returns the human-readable format name.
Returns Human-readable format name.
55 56 57 |
# File 'lib/indis-core/binary_format.rb', line 55 def self.name raise RuntimeError end |