Class: Omnizip::Models::ConversionOptions

Inherits:
Lutaml::Model::Serializable
  • Object
show all
Defined in:
lib/omnizip/models/conversion_options.rb

Overview

Options for converting between archive formats.

Serialized via lutaml-model — no hand-rolled to_h / to_json.

Constant Summary collapse

VALID_FORMATS =
%i[zip seven_zip 7z].freeze

Instance Method Summary collapse

Instance Method Details

#validate_options!Boolean

Validate that formats and compression level are in range.

Named validate_options! rather than validate so it does not shadow Lutaml::Model::Validation#validate(register:).

Returns:

  • (Boolean)

    true if valid

Raises:

  • (ArgumentError)

    if any value is invalid



54
55
56
57
58
59
60
# File 'lib/omnizip/models/conversion_options.rb', line 54

def validate_options!
  validate_format(target_format, "target")
  validate_format(source_format, "source") if source_format
  validate_compression_level

  true
end