Class: Cabriolet::Models::OABBlockHeader
- Inherits:
-
Object
- Object
- Cabriolet::Models::OABBlockHeader
- Defined in:
- lib/cabriolet/models/oab_header.rb
Overview
OAB block header for full files
Instance Attribute Summary collapse
-
#compressed_size ⇒ Object
Returns the value of attribute compressed_size.
-
#crc ⇒ Object
Returns the value of attribute crc.
-
#flags ⇒ Object
Returns the value of attribute flags.
-
#uncompressed_size ⇒ Object
Returns the value of attribute uncompressed_size.
Instance Method Summary collapse
-
#compressed? ⇒ Boolean
Check if block is compressed.
-
#initialize(flags:, compressed_size:, uncompressed_size:, crc:) ⇒ OABBlockHeader
constructor
A new instance of OABBlockHeader.
-
#uncompressed? ⇒ Boolean
Check if block is uncompressed.
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_size ⇒ Object
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 |
#crc ⇒ Object
Returns the value of attribute crc.
59 60 61 |
# File 'lib/cabriolet/models/oab_header.rb', line 59 def crc @crc end |
#flags ⇒ Object
Returns the value of attribute flags.
59 60 61 |
# File 'lib/cabriolet/models/oab_header.rb', line 59 def flags @flags end |
#uncompressed_size ⇒ Object
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
71 72 73 |
# File 'lib/cabriolet/models/oab_header.rb', line 71 def compressed? flags == 1 end |
#uncompressed? ⇒ Boolean
Check if block is uncompressed
78 79 80 |
# File 'lib/cabriolet/models/oab_header.rb', line 78 def uncompressed? flags.zero? end |