Sha256: e368390e1852b2620480b05c470bab6d1edd1db9d9293986688ab5d67321f854

Contents?: true

Size: 916 Bytes

Versions: 47

Compression:

Stored size: 916 Bytes

Contents

module Isomorfeus
  class << self
    def cached_operation_classes
      @cached_operation_classes ||= {}
    end

    def cached_operation_class(class_name)
      return "::#{class_name}".constantize if Isomorfeus.development?
      return cached_operation_classes[class_name] if cached_operation_classes.key?(class_name)
      cached_operation_classes[class_name] = "::#{class_name}".constantize
    end

    if RUBY_ENGINE != 'opal'
      def valid_operation_class_names
        @valid_operation_class_names ||= Set.new
      end

      def valid_operation_class_name?(class_name)
        valid_operation_class_names.include?(class_name)
      end

      def add_valid_operation_class(klass)
        class_name = klass.name
        class_name = class_name.split('>::').last if class_name.start_with?('#<')
        valid_operation_class_names << class_name
      end
    end
  end
end

Version data entries

47 entries across 47 versions & 1 rubygems

Version Path
isomorfeus-operation-2.2.11 lib/isomorfeus/operation/config.rb
isomorfeus-operation-2.2.10 lib/isomorfeus/operation/config.rb
isomorfeus-operation-2.2.9 lib/isomorfeus/operation/config.rb
isomorfeus-operation-2.2.8 lib/isomorfeus/operation/config.rb
isomorfeus-operation-2.2.7 lib/isomorfeus/operation/config.rb
isomorfeus-operation-2.2.6 lib/isomorfeus/operation/config.rb
isomorfeus-operation-2.2.5 lib/isomorfeus/operation/config.rb
isomorfeus-operation-2.2.4 lib/isomorfeus/operation/config.rb
isomorfeus-operation-2.2.3 lib/isomorfeus/operation/config.rb
isomorfeus-operation-2.2.2 lib/isomorfeus/operation/config.rb
isomorfeus-operation-2.2.1 lib/isomorfeus/operation/config.rb
isomorfeus-operation-2.2.0 lib/isomorfeus/operation/config.rb
isomorfeus-operation-2.1.1 lib/isomorfeus/operation/config.rb
isomorfeus-operation-2.1.0 lib/isomorfeus/operation/config.rb
isomorfeus-operation-2.0.22 lib/isomorfeus/operation/config.rb
isomorfeus-operation-2.0.21 lib/isomorfeus/operation/config.rb
isomorfeus-operation-2.0.20 lib/isomorfeus/operation/config.rb
isomorfeus-operation-2.0.19 lib/isomorfeus/operation/config.rb
isomorfeus-operation-2.0.18 lib/isomorfeus/operation/config.rb
isomorfeus-operation-2.0.17 lib/isomorfeus/operation/config.rb