Class: R509::Engine
Overview
a singleton class to store loaded OpenSSL Engines
Instance Method Summary collapse
-
#[](key) ⇒ Object
Takes an engine ID and returns the engine object.
-
#initialize ⇒ Engine
constructor
A new instance of Engine.
-
#load(hash) ⇒ Object
OpenSSL::Engine object.
Constructor Details
#initialize ⇒ Engine
Returns a new instance of Engine
9 10 11 |
# File 'lib/r509/engine.rb', line 9 def initialize @engines = {} end |
Instance Method Details
#[](key) ⇒ Object
Takes an engine ID and returns the engine object
25 26 27 |
# File 'lib/r509/engine.rb', line 25 def [](key) @engines[key] end |
#load(hash) ⇒ Object
Returns OpenSSL::Engine object
15 16 17 18 19 20 21 22 |
# File 'lib/r509/engine.rb', line 15 def load(hash) validate_hash(hash) if @engines.key?(hash[:id]) @engines[hash[:id]] else init_engine(hash) end end |