# File lib/erector/after_initialize.rb, line 8 def after_initialize(instance=nil, &blk) if blk after_initialize_parts << blk elsif instance if superclass.respond_to?(:after_initialize) superclass.after_initialize instance end after_initialize_parts.each do |part| instance.instance_eval &part end else raise ArgumentError, "You must provide either an instance or a block" end end
# File lib/erector/after_initialize.rb, line 24 def after_initialize_parts @after_initialize_parts ||= [] end