Sha256: ddc2586d583548326bf76150f73bee22eec139ded12c5f2e3620027cf6edb426

Contents?: true

Size: 703 Bytes

Versions: 12

Compression:

Stored size: 703 Bytes

Contents

module ROM
  module Plugins
    module Relation
      # Allows relations to access all other relations through registry
      #
      # For now this plugin is always enabled
      #
      # @api public
      module RegistryReader
        # @api private
        def self.included(klass)
          super
          klass.option :__registry__, type: Hash, default: EMPTY_HASH, reader: true
        end

        # @api private
        def respond_to_missing?(name, _include_private = false)
          __registry__.key?(name) || super
        end

        private

        # @api private
        def method_missing(name, *)
          __registry__.fetch(name) { super }
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
rom-1.0.0 lib/rom/plugins/relation/registry_reader.rb
rom-1.0.0.rc1 lib/rom/plugins/relation/registry_reader.rb
rom-1.0.0.beta2 lib/rom/plugins/relation/registry_reader.rb
rom-1.0.0.beta1 lib/rom/plugins/relation/registry_reader.rb
rom-0.9.1 lib/rom/plugins/relation/registry_reader.rb
rom-0.9.0 lib/rom/plugins/relation/registry_reader.rb
rom-0.9.0.rc1 lib/rom/plugins/relation/registry_reader.rb
rom-0.9.0.beta1 lib/rom/plugins/relation/registry_reader.rb
rom-0.8.1 lib/rom/plugins/relation/registry_reader.rb
rom-0.8.0 lib/rom/plugins/relation/registry_reader.rb
rom-0.7.1 lib/rom/plugins/relation/registry_reader.rb
rom-0.7.0 lib/rom/plugins/relation/registry_reader.rb