Class: ParamStore::Adapters::EJSONWrapper

Inherits:
Object
  • Object
show all
Defined in:
lib/param_store/adapters/ejson_wrapper.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_pathObject (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

#optionsObject (readonly)

Returns the value of attribute options.



4
5
6
# File 'lib/param_store/adapters/ejson_wrapper.rb', line 4

def options
  @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