Class: SfnParameters::Safe
- Inherits:
-
Object
- Object
- SfnParameters::Safe
- Defined in:
- lib/sfn-parameters/safe.rb,
lib/sfn-parameters/safe/ssl.rb
Overview
Safe storage
Direct Known Subclasses
Defined Under Namespace
Classes: Ssl
Instance Attribute Summary collapse
-
#arguments ⇒ Hash
readonly
Safe configuration.
Class Method Summary collapse
-
.build(args = {}) ⇒ Safe
Build a new safe instance.
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ self
constructor
Create a new safe.
-
#lock(value) ⇒ Hash
Lock a given value for storage.
-
#unlock(value) ⇒ String
Unlock a given value for access.
Constructor Details
#initialize(args = {}) ⇒ self
Create a new safe
15 16 17 |
# File 'lib/sfn-parameters/safe.rb', line 15 def initialize(args = {}) @arguments = args.to_smash end |
Instance Attribute Details
#arguments ⇒ Hash (readonly)
Returns safe configuration.
9 10 11 |
# File 'lib/sfn-parameters/safe.rb', line 9 def arguments @arguments end |
Class Method Details
.build(args = {}) ⇒ Safe
Build a new safe instance
42 43 44 45 46 47 48 49 50 |
# File 'lib/sfn-parameters/safe.rb', line 42 def build(args = {}) args = args.to_smash type = Bogo::Utility.camel(args.fetch(:type, "ssl")) if const_defined?(type) const_get(type).new(args) else raise ArgumentError.new "Unknown safe type provided `#{type}`." end end |
Instance Method Details
#lock(value) ⇒ Hash
Lock a given value for storage
23 24 25 |
# File 'lib/sfn-parameters/safe.rb', line 23 def lock(value) raise NotImplementedError end |
#unlock(value) ⇒ String
Unlock a given value for access
31 32 33 |
# File 'lib/sfn-parameters/safe.rb', line 31 def unlock(value) raise NotImplementedError end |