Module: Dotcrypt::Serializers

Defined in:
lib/dotcrypt/serializers.rb

Defined Under Namespace

Classes: ENV, JSON, Serializer, YAML

Constant Summary collapse

SERIALIZERS =
{
  json: Dotcrypt::Serializers::JSON,
  env: Dotcrypt::Serializers::ENV,
  yaml: Dotcrypt::Serializers::YAML
}.freeze

Class Method Summary collapse

Class Method Details

.for(format) ⇒ Object



10
11
12
13
14
# File 'lib/dotcrypt/serializers.rb', line 10

def self.for(format)
  SERIALIZERS.fetch(format.to_sym)
rescue KeyError
  raise ArgumentError, "unknown format: '#{format}', supported formats: #{SERIALIZERS.keys}"
end