Class: Cabriolet::Models::OABBlockHeader

Inherits:
Object
  • Object
show all
Defined in:
lib/cabriolet/models/oab_header.rb

Overview

OAB block header for full files

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(flags:, compressed_size:, uncompressed_size:, crc:) ⇒ OABBlockHeader

Returns a new instance of OABBlockHeader.



61
62
63
64
65
66
# File 'lib/cabriolet/models/oab_header.rb', line 61

def initialize(flags:, compressed_size:, uncompressed_size:, crc:)
  @flags = flags
  @compressed_size = compressed_size
  @uncompressed_size = uncompressed_size
  @crc = crc
end

Instance Attribute Details

#compressed_sizeObject

Returns the value of attribute compressed_size.



59
60
61
# File 'lib/cabriolet/models/oab_header.rb', line 59

def compressed_size
  @compressed_size
end

#crcObject

Returns the value of attribute crc.



59
60
61
# File 'lib/cabriolet/models/oab_header.rb', line 59

def crc
  @crc
end

#flagsObject

Returns the value of attribute flags.



59
60
61
# File 'lib/cabriolet/models/oab_header.rb', line 59

def flags
  @flags
end

#uncompressed_sizeObject

Returns the value of attribute uncompressed_size.



59
60
61
# File 'lib/cabriolet/models/oab_header.rb', line 59

def uncompressed_size
  @uncompressed_size
end

Instance Method Details

#compressed?Boolean

Check if block is compressed

Returns:

  • (Boolean)


71
72
73
# File 'lib/cabriolet/models/oab_header.rb', line 71

def compressed?
  flags == 1
end

#uncompressed?Boolean

Check if block is uncompressed

Returns:

  • (Boolean)


78
79
80
# File 'lib/cabriolet/models/oab_header.rb', line 78

def uncompressed?
  flags.zero?
end