Sha256: 537ec3b990584703db0f7c74f9768d5ad48434b61598049f1ad343da5f6e517c
Contents?: true
Size: 488 Bytes
Versions: 7
Compression:
Stored size: 488 Bytes
Contents
# frozen_string_literal: true module ONEAccess module Serializable def represented_by(representer_class) @representer_class = representer_class end def from_json(json) if collection? collection = [] @representer_class.new(collection).from_json(json) collection else obj = new @representer_class.new(obj).from_json(json) obj end end private def collection? false end end end
Version data entries
7 entries across 7 versions & 1 rubygems