module ActiveAny::Delegation::ClassSpecificRelation::ClassMethods

Public Instance Methods

delegate(method, opts = {}) click to toggle source
Calls superclass method
# File lib/active_any/relation/delegation.rb, line 64
def delegate(method, opts = {})
  @delegation_mutex.synchronize do
    return if method_defined?(method)
    super
  end
end
delegate_to_scoped_klass(method) click to toggle source
# File lib/active_any/relation/delegation.rb, line 46
        def delegate_to_scoped_klass(method)
          @delegation_mutex.synchronize do
            return if method_defined?(method)

            if /\A[a-zA-Z_]\w*[!?]?\z/.match?(method)
              module_eval <<-RUBY, __FILE__, __LINE__ + 1
                def #{method}(*args, &block)
                  scoping { @klass.#{method}(*args, &block) }
                end
              RUBY
            else
              define_method method do |*args, &block|
                scoping { @klass.public_send(method, *args, &block) }
              end
            end
          end
        end
name() click to toggle source
# File lib/active_any/relation/delegation.rb, line 42
def name
  superclass.name
end