Sha256: de4b29674b4ad26738f106628fee29c67e62317a216028c6d0df5e561b2a095b

Contents?: true

Size: 287 Bytes

Versions: 3

Compression:

Stored size: 287 Bytes

Contents

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

    def self.all
      @serializers ||= {json: JSON.method(:pretty_generate)}
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
yaks-0.6.2 lib/yaks/serializer.rb
yaks-0.6.1 lib/yaks/serializer.rb
yaks-0.6.0 lib/yaks/serializer.rb