Sha256: e7696d9368aadd45b6878910cd1478b4b3a4ad8c4804378033b7abf323239e13

Contents?: true

Size: 387 Bytes

Versions: 1

Compression:

Stored size: 387 Bytes

Contents

# frozen_string_literal: true

# This module tracks which classes inherit from the class that includes
# the module, and provides an accessor to it.

module DispatchRider
  module Handlers
    module InheritanceTracking
      def inherited(subclass)
        subclasses << subclass
        super
      end

      def subclasses
        @subclasses ||= Set.new
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dispatch-rider-2.2.0 lib/dispatch-rider/handlers/inheritance_tracking.rb