Module: MagicPipe::Codecs

Defined in:
lib/magic_pipe/codecs.rb,
lib/magic_pipe/codecs/base.rb,
lib/magic_pipe/codecs/json.rb,
lib/magic_pipe/codecs/yaml.rb,
lib/magic_pipe/codecs/thrift.rb

Defined Under Namespace

Classes: Base, Json, Thrift, Yaml

Class Method Summary collapse

Class Method Details

.lookup(type) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/magic_pipe/codecs.rb', line 3

def self.lookup(type)
  case type
  when :json then Json
  when :thrift then Thrift
  when :msgpack, :message_pack then MessagePack
  when :yaml then Yaml
  when Class then type
  else
    raise ConfigurationError, "Unknown MagicPipe::Codecs type: '#{type}'."
  end
end