7stud2
(7stud --)
12 May 2013 14:05
1
Hi,
I just introduced one callback says
http://www.ruby-doc.org/core-2.0/Module.html#method-i-extend_object .
extend_object(obj) → obj
But I am familiar with Module#extended hook. But not understood while
`Module#extended` we have,then why `Module#extend_object`?
Is there any difference between them?
Thanks
···
--
Posted via http://www.ruby-forum.com/ .
They have complete different uses. #extended is a hook run *after*
you extend an Object using #extend_object .
···
On Sun, May 12, 2013 at 9:05 AM, Love U Ruby <lists@ruby-forum.com> wrote:
Hi,
I just introduced one callback says
Class: Module (Ruby 2.0.0) .
extend_object(obj) → obj
But I am familiar with Module#extended hook. But not understood while
`Module#extended` we have,then why `Module#extend_object`?
Is there any difference between them?
7stud2
(7stud --)
13 May 2013 06:46
3
what if you want to add a feature that exending an specific module does
only work for some special objects?
you can raise an error in #extended but in this its allready to late so
you need #extend_object
···
--
Posted via http://www.ruby-forum.com/ .
7stud2
(7stud --)
13 May 2013 05:50
4
tamouse mailing lists wrote in post #1108691:
···
On Sun, May 12, 2013 at 9:05 AM, Love U Ruby <lists@ruby-forum.com> > wrote:
Is there any difference between them?
They have complete different uses. #extended is a hook run *after*
you extend an Object using #extend_object .
No both of them are hooks,as docs mentioned. Thus I wanted to know while
`extended` hook we have what are the special needs of the hook
`extend_object`?
Thanks
--
Posted via http://www.ruby-forum.com/\ .