mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
AS guide: documents Object#extend_with_included_modules_from
This commit is contained in:
parent
cf82ddc96a
commit
907754d7ee
1 changed files with 21 additions and 0 deletions
|
@ -388,6 +388,27 @@ C.extended_by # => [N, N2, M]
|
|||
|
||||
NOTE: Defined in +active_support/core_ext/object/extending.rb+.
|
||||
|
||||
h5. +extend_with_included_modules_from+
|
||||
|
||||
The method +extend_with_included_modules_from+ extends its receiver with the modules that extend its argument:
|
||||
|
||||
<ruby>
|
||||
module M
|
||||
end
|
||||
|
||||
class C
|
||||
extend M
|
||||
end
|
||||
|
||||
class D
|
||||
end
|
||||
|
||||
D.extend_with_included_modules_from(C)
|
||||
D.extended_by # => [M]
|
||||
</ruby>
|
||||
|
||||
NOTE: Defined in +active_support/core_ext/object/extending.rb+.
|
||||
|
||||
h4. Instance Variables
|
||||
|
||||
Active Support provides several methods to ease access to instance variables.
|
||||
|
|
Loading…
Reference in a new issue