Sha256: 2a4b74928f03802e15c76be2b07ffb23db6a3604a4824ffa85c370a651ec869e

Contents?: true

Size: 546 Bytes

Versions: 2

Compression:

Stored size: 546 Bytes

Contents

module ParamStore
  module Adapters
    class EJSONWrapper
      attr_reader :file_path, :options

      def initialize(**opts)
        @file_path = opts.delete(:file_path)
        @options = opts
      end

      def fetch(key, *args, **_opts, &block)
        decrypt.fetch(key, *args, &block)
      end

      def fetch_all(*keys, **_opts)
        decrypt.select { |key, _value| keys.flatten.include?(key) }
      end

      private

      def decrypt
        @_decrypt ||= ::EJSONWrapper.decrypt(file_path, options)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
param_store-1.0.1 lib/param_store/adapters/ejson_wrapper.rb
param_store-1.0.0 lib/param_store/adapters/ejson_wrapper.rb