Class: Omnizip::Formats::Rar::Rar5::Models::RecoveryOptions
- Inherits:
-
Lutaml::Model::Serializable
- Object
- Lutaml::Model::Serializable
- Omnizip::Formats::Rar::Rar5::Models::RecoveryOptions
- Defined in:
- lib/omnizip/formats/rar/rar5/models/recovery_options.rb
Overview
Recovery (PAR2) options for RAR5 archives
This model configures PAR2 parity file generation for error correction and recovery of corrupted or missing archive data.
Instance Method Summary collapse
-
#enabled? ⇒ Boolean
Check if recovery is enabled.
-
#validate! ⇒ Object
Validate options.
Instance Method Details
#enabled? ⇒ Boolean
Check if recovery is enabled
55 56 57 |
# File 'lib/omnizip/formats/rar/rar5/models/recovery_options.rb', line 55 def enabled? enabled == true end |
#validate! ⇒ Object
Validate options
40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/omnizip/formats/rar/rar5/models/recovery_options.rb', line 40 def validate! if redundancy.negative? || redundancy > 100 raise ArgumentError, "Redundancy must be 0-100, got #{redundancy}" end if block_size <= 0 || (block_size % 4) != 0 raise ArgumentError, "Block size must be positive and divisible by 4" end end |