Class: ParamStore::Adapters::EJSONWrapper
- Inherits:
-
Object
- Object
- ParamStore::Adapters::EJSONWrapper
- Defined in:
- lib/param_store/adapters/ejson_wrapper.rb
Instance Attribute Summary collapse
-
#file_path ⇒ Object
readonly
Returns the value of attribute file_path.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #fetch(key, *args, **_opts, &block) ⇒ Object
- #fetch_all(*keys, **_opts) ⇒ Object
-
#initialize(**opts) ⇒ EJSONWrapper
constructor
A new instance of EJSONWrapper.
Constructor Details
#initialize(**opts) ⇒ EJSONWrapper
Returns a new instance of EJSONWrapper.
6 7 8 9 |
# File 'lib/param_store/adapters/ejson_wrapper.rb', line 6 def initialize(**opts) @file_path = opts.delete(:file_path) @options = opts end |
Instance Attribute Details
#file_path ⇒ Object (readonly)
Returns the value of attribute file_path.
4 5 6 |
# File 'lib/param_store/adapters/ejson_wrapper.rb', line 4 def file_path @file_path end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
4 5 6 |
# File 'lib/param_store/adapters/ejson_wrapper.rb', line 4 def @options end |
Instance Method Details
#fetch(key, *args, **_opts, &block) ⇒ Object
11 12 13 |
# File 'lib/param_store/adapters/ejson_wrapper.rb', line 11 def fetch(key, *args, **_opts, &block) decrypt.fetch(key, *args, &block) end |
#fetch_all(*keys, **_opts) ⇒ Object
15 16 17 |
# File 'lib/param_store/adapters/ejson_wrapper.rb', line 15 def fetch_all(*keys, **_opts) decrypt.select { |key, _value| keys.flatten.include?(key) } end |