Class: Indis::BinaryFormat::Format

Inherits:
Object
  • Object
show all
Defined in:
lib/indis-core/binary_format.rb

Overview

Base class for any binary format.

Class Method Summary collapse

Instance Method Summary collapse

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

.magicFixnum

This method is abstract.

Returns the format magic bytes.

Returns Magic bytes that are checked against the first bytes in binary.

Returns:

  • (Fixnum)

    Magic bytes that are checked against the first bytes in binary.

Raises:

  • (RuntimeError)


48
49
50
# File 'lib/indis-core/binary_format.rb', line 48

def self.magic
  raise RuntimeError
end

.nameString

This method is abstract.

Returns the human-readable format name.

Returns Human-readable format name.

Returns:

  • (String)

    Human-readable format name.

Raises:

  • (RuntimeError)


55
56
57
# File 'lib/indis-core/binary_format.rb', line 55

def self.name
  raise RuntimeError
end