Sha256: e5410d6b55ab99ed64fb24839514aa786615896977831f98b7c3c8baa090a15b

Contents?: true

Size: 887 Bytes

Versions: 19

Compression:

Stored size: 887 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

19 entries across 19 versions & 1 rubygems

Version Path
isomorfeus-operation-1.0.0.zeta25 lib/isomorfeus/operation/config.rb
isomorfeus-operation-1.0.0.zeta24 lib/isomorfeus/operation/config.rb
isomorfeus-operation-1.0.0.zeta23 lib/isomorfeus/operation/config.rb
isomorfeus-operation-1.0.0.zeta22 lib/isomorfeus/operation/config.rb
isomorfeus-operation-1.0.0.zeta21 lib/isomorfeus/operation/config.rb
isomorfeus-operation-1.0.0.zeta20 lib/isomorfeus/operation/config.rb
isomorfeus-operation-1.0.0.zeta19 lib/isomorfeus/operation/config.rb
isomorfeus-operation-1.0.0.zeta18 lib/isomorfeus/operation/config.rb
isomorfeus-operation-1.0.0.zeta17 lib/isomorfeus/operation/config.rb
isomorfeus-operation-1.0.0.zeta16 lib/isomorfeus/operation/config.rb
isomorfeus-operation-1.0.0.zeta15 lib/isomorfeus/operation/config.rb
isomorfeus-operation-1.0.0.zeta14 lib/isomorfeus/operation/config.rb
isomorfeus-operation-1.0.0.zeta13 lib/isomorfeus/operation/config.rb
isomorfeus-operation-1.0.0.zeta12 lib/isomorfeus/operation/config.rb
isomorfeus-operation-1.0.0.zeta11 lib/isomorfeus/operation/config.rb
isomorfeus-operation-1.0.0.zeta10 lib/isomorfeus/operation/config.rb
isomorfeus-operation-1.0.0.zeta9 lib/isomorfeus/operation/config.rb
isomorfeus-operation-1.0.0.zeta8 lib/isomorfeus/operation/config.rb
isomorfeus-operation-1.0.0.zeta6 lib/isomorfeus/operation/config.rb