Class: Sym::Configuration
Overview
This class encapsulates application configuration, and exports a familiar method #configure
for defining configuration in a block.
It’s values are requested by the library upon encryption or decryption, or any other operation.
Example
The following is an actual initialization from the code of this library. You may override any of the value defined below in your code, but before you use library’s encryption methods.
Sym::Configuration.configure do |config|
config.password_cipher = 'AES-128-CBC' #
config.data_cipher = 'AES-256-CBC'
config.private_key_cipher = config.data_cipher
config.compression_enabled = true
config.compression_level = Zlib::BEST_COMPRESSION
end
Class Attribute Summary collapse
-
.config ⇒ Object
Returns the value of attribute config.
Instance Attribute Summary collapse
-
#compression_enabled ⇒ Object
See file
lib/sym.rb
where these values are defined. -
#compression_level ⇒ Object
See file
lib/sym.rb
where these values are defined. -
#data_cipher ⇒ Object
See file
lib/sym.rb
where these values are defined. -
#default_key_file ⇒ Object
See file
lib/sym.rb
where these values are defined. -
#encrypted_file_extension ⇒ Object
See file
lib/sym.rb
where these values are defined. -
#password_cache_arguments ⇒ Object
See file
lib/sym.rb
where these values are defined. -
#password_cache_default_provider ⇒ Object
See file
lib/sym.rb
where these values are defined. -
#password_cache_timeout ⇒ Object
See file
lib/sym.rb
where these values are defined. -
#password_cipher ⇒ Object
See file
lib/sym.rb
where these values are defined. -
#private_key_cipher ⇒ Object
See file
lib/sym.rb
where these values are defined.
Class Method Summary collapse
Class Attribute Details
.config ⇒ Object
Returns the value of attribute config.
24 25 26 |
# File 'lib/sym/configuration.rb', line 24 def config @config end |
Instance Attribute Details
#compression_enabled ⇒ Object
See file lib/sym.rb
where these values are defined.
38 39 40 |
# File 'lib/sym/configuration.rb', line 38 def compression_enabled @compression_enabled end |
#compression_level ⇒ Object
See file lib/sym.rb
where these values are defined.
38 39 40 |
# File 'lib/sym/configuration.rb', line 38 def compression_level @compression_level end |
#data_cipher ⇒ Object
See file lib/sym.rb
where these values are defined.
38 39 40 |
# File 'lib/sym/configuration.rb', line 38 def data_cipher @data_cipher end |
#default_key_file ⇒ Object
See file lib/sym.rb
where these values are defined.
38 39 40 |
# File 'lib/sym/configuration.rb', line 38 def default_key_file @default_key_file end |
#encrypted_file_extension ⇒ Object
See file lib/sym.rb
where these values are defined.
38 39 40 |
# File 'lib/sym/configuration.rb', line 38 def encrypted_file_extension @encrypted_file_extension end |
#password_cache_arguments ⇒ Object
See file lib/sym.rb
where these values are defined.
38 39 40 |
# File 'lib/sym/configuration.rb', line 38 def password_cache_arguments @password_cache_arguments end |
#password_cache_default_provider ⇒ Object
See file lib/sym.rb
where these values are defined.
38 39 40 |
# File 'lib/sym/configuration.rb', line 38 def password_cache_default_provider @password_cache_default_provider end |
#password_cache_timeout ⇒ Object
See file lib/sym.rb
where these values are defined.
38 39 40 |
# File 'lib/sym/configuration.rb', line 38 def password_cache_timeout @password_cache_timeout end |
#password_cipher ⇒ Object
See file lib/sym.rb
where these values are defined.
38 39 40 |
# File 'lib/sym/configuration.rb', line 38 def password_cipher @password_cipher end |
#private_key_cipher ⇒ Object
See file lib/sym.rb
where these values are defined.
38 39 40 |
# File 'lib/sym/configuration.rb', line 38 def private_key_cipher @private_key_cipher end |
Class Method Details
.configure {|config| ... } ⇒ Object
26 27 28 29 |
# File 'lib/sym/configuration.rb', line 26 def configure self.config ||= Configuration.new yield config if block_given? end |
.property(name) ⇒ Object
31 32 33 |
# File 'lib/sym/configuration.rb', line 31 def property(name) self.config.send(name) end |