Module: Yaks::Serializer

Defined in:
lib/yaks/serializer.rb

Defined Under Namespace

Modules: JSONReader, JSONWriter

Class Method Summary collapse

Class Method Details

.allObject



8
9
10
# File 'lib/yaks/serializer.rb', line 8

def self.all
  @serializers ||= {json: JSONWriter}
end

.register(format, serializer) ⇒ Object



3
4
5
6
# File 'lib/yaks/serializer.rb', line 3

def self.register(format, serializer)
  raise "Serializer for #{format} already registered" if all.key? format
  all[format] = serializer
end