For Object#extend, the hook/callbacks methods are extend_object and extended.
For Module#include, the hook/callbacks methods are append_features and included.
The name append_features is a bit confusing / inconsistent.
What about renaming append_features to include_module (similar as extend_object for extend) ?
Alternatively, include_module could be defined as an alias to append_features (the latter could be made deprecated).
Thanks.
=end
In message "Re: [ruby-core:33419] [Ruby 1.9-Feature#4065] Rename or alias module#append_features to module#include_module"
on Sat, 27 Nov 2010 17:14:44 +0900, Chauk-Mean Proum redmine@ruby-lang.org writes:
|Issue #4065 has been updated by Chauk-Mean Proum.
|
|Given the discussion from http://www.ruby-forum.com/topic/469691#new ,
|
|I revised my proposal as following :
|For Object#extend, the hook/callbacks methods would be :
|- pre_extended (instead of extend_object)
|- extended (no change)
|For Module#include, the hook/callbacks methods would be :
|- pre_included (instead of append_features)
|- included (no change)
I don't think it is worth breaking many existing programs that use
extend_object / append_feature for aesthetic reason. Besides that,
unlike extended, extend_object is not a hook.