Class: DeepStore::CodecFactory

Inherits:
Object
  • Object
show all
Defined in:
lib/deep_store/codec_factory.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.call(*args) ⇒ Object



3
4
5
# File 'lib/deep_store/codec_factory.rb', line 3

def self.call(*args)
  new.call(*args)
end

Instance Method Details

#call(codec_id, options = {}) ⇒ Object



7
8
9
10
11
12
13
14
# File 'lib/deep_store/codec_factory.rb', line 7

def call(codec_id, options = {})
  case codec_id
  when :gzip
    Codecs::GzipCodec.new(options)
  else
    Codecs::NullCodec.new(options)
  end
end