Module: Cattri::DeferredAttributes::Hook

Defined in:
lib/cattri/deferred_attributes.rb

Overview

Hook methods for inclusion/extension that trigger deferred application.

Instance Method Summary collapse

Instance Method Details

#extended(target) ⇒ void

This method returns an undefined value.

Called when a module including ‘DeferredAttributes` is extended into another module/class.

Parameters:

  • target (Module)

    the extending class or module



37
38
39
# File 'lib/cattri/deferred_attributes.rb', line 37

def extended(target)
  apply_deferred_attributes(target) if respond_to?(:apply_deferred_attributes) # steep:ignore
end

#included(target) ⇒ void

This method returns an undefined value.

Called when a module including ‘DeferredAttributes` is included into another module/class.

Parameters:

  • target (Module)

    the including class or module



29
30
31
# File 'lib/cattri/deferred_attributes.rb', line 29

def included(target)
  apply_deferred_attributes(target) if respond_to?(:apply_deferred_attributes) # steep:ignore
end