Sha256: f16a2708cd3b70cf7ecc68cc6bb4af504cf2c8cc807ba6d777d7ac95f21a066b

Contents?: true

Size: 346 Bytes

Versions: 7

Compression:

Stored size: 346 Bytes

Contents

# frozen_string_literal: true

module AdequateSerialization
  module Serializable
    def self.included(base)
      base.extend(ClassMethods)
    end

    module ClassMethods
      def serializer
        @serializer ||= const_get("#{name}Serializer").new
      end
    end

    def as_json(*opts)
      Steps.apply(self, *opts)
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
adequate_serialization-2.0.1 lib/adequate_serialization/serializable.rb
adequate_serialization-2.0.0 lib/adequate_serialization/serializable.rb
adequate_serialization-1.0.1 lib/adequate_serialization/serializable.rb
adequate_serialization-1.0.0 lib/adequate_serialization/serializable.rb
adequate_serialization-0.1.1 lib/adequate_serialization/serializable.rb
adequate_serialization-0.1.0 lib/adequate_serialization/serializable.rb
adequate_serialization-0.0.1 lib/adequate_serialization/serializable.rb