123456789_123456789_123456789_123456789_123456789_

Module: ActiveRecord::DynamicMatchers

Do not use. This module is for internal use only.
Relationships & Source Files
Namespace Children
Classes:
Extension / Inclusion / Inheritance Descendants
Extended In:
Defined in: activerecord/lib/active_record/dynamic_matchers.rb

Instance Method Summary

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name) (private)

[ GitHub ]

  
# File 'activerecord/lib/active_record/dynamic_matchers.rb', line 15

def method_missing(name, ...)
  match = Method.match(self, name)

  if match && match.valid?
    match.define
    send(name, ...)
  else
    super
  end
end

Instance Method Details

#respond_to_missing?(name, _) ⇒ Boolean (private)

[ GitHub ]

  
# File 'activerecord/lib/active_record/dynamic_matchers.rb', line 6

def respond_to_missing?(name, _)
  if self == Base
    super
  else
    match = Method.match(self, name)
    match && match.valid? || super
  end
end