Charyf/charyf-core

View on GitHub
lib/charyf/utils/app_engine/extensions.rb

Summary

Maintainability
A
0 mins
Test Coverage
module Charyf
  class AppEngine < Extension
    class Extensions
      include Enumerable
      attr_reader :_all

      def initialize
        @_all ||= ::Charyf::Extension.subclasses.map(&:instance) +
            ::Charyf::AppEngine.subclasses.map(&:instance)
      end

      def each(*args, &block)
        _all.each(*args, &block)
      end

      def -(others)
        _all - others
      end
    end
  end
end