Sha256: 56f19de250f007a596ef2ff67b952d14f459c8ad2e87f30203a83681c66670fa
Contents?: true
Size: 309 Bytes
Versions: 5
Compression:
Stored size: 309 Bytes
Contents
class Serializers class Base @@structures = {} def self.structure(type, &blk) @@structures["#{self.name}::#{type}"] = blk end def initialize(type) @type = type end def serialize(object) @@structures["#{self.class.name}::#{@type}"].call(object) end end end
Version data entries
5 entries across 5 versions & 1 rubygems