Sha256: caf5145e3ddbef7a31278687d9c4e3fb93626de6802ef732271b1889a93bab84

Contents?: true

Size: 481 Bytes

Versions: 3

Compression:

Stored size: 481 Bytes

Contents

module ROM
  class Relation
    module RegistryReader
      # @api private
      def self.included(klass)
        super
        klass.option :__registry__, type: Hash, default: {}, 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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rom-0.6.0.beta3 lib/rom/relation/registry_reader.rb
rom-0.6.0.beta2 lib/rom/relation/registry_reader.rb
rom-0.6.0.beta1 lib/rom/relation/registry_reader.rb