module Ivar::Checked::InstanceMethods
def self.prepend_features(othermod)
(like, say, initialize), we have to stash the original method implementation if we ever want to find out its
The semantics of prepend are such that the super method becomes wholly inaccessible. So if we override a method
def self.prepend_features(othermod) (instance_methods(false) | private_instance_methods(false)).each do |method_name| Ivar.stash_method(othermod, method_name) end super end
def initialize(*args, **kwargs, &block)
1. Processing manifest declarations before calling super
This method handles the initialization process, including:
Wrap the initialize method to automatically call check_ivars
def initialize(*args, **kwargs, &block) if @__ivar_skip_init super else @__ivar_skip_init = true manifest = Ivar.get_or_create_manifest(self.class) manifest.process_before_init(self, args, kwargs) super check_ivars end end