Method: Rnp::Sign#compression=

Defined in:
lib/rnp/op/sign.rb

#compression=(compression) ⇒ Object

Set the compression algorithm and level.

Parameters:

  • compression (Hash<Symbol>)

Options Hash (compression):

  • :algorithm (String)

    the compression algorithm (bzip2, etc)

  • :level (Integer)

    the compression level. This should generally be between 0 (no compression) and 9 (best compression).



83
84
85
86
87
88
89
90
# File 'lib/rnp/op/sign.rb', line 83

def compression=(compression)
  if !compression.is_a?(Hash) || Set.new(compression.keys) != Set.new(%i[algorithm level])
    raise ArgumentError,
          'Compression option must be of the form: {algorithm: \'zlib\', level: 5}'
  end
  Rnp.call_ffi(:rnp_op_sign_set_compression, @ptr, compression[:algorithm],
               compression[:level])
end