From: Caleb Clausen on 23 Mar 2010 19:40 On 3/23/10, Smart RoR <deepikarohit(a)gmail.com> wrote: > In the end, I wanted to see A as ancestor of B. > No classes, only modules. So, then, you should use include, I think. It's like inheiritance, but for modules: module A;end module B include A end B.ancestors #=> [B, A]
From: Robert Klemme on 24 Mar 2010 04:33 2010/3/23 Caleb Clausen <vikkous(a)gmail.com>: > Am I missing something? Why not just include A from B? Like this: *I* am the one missing something. I had this nagging feeling that there must be a simpler way but apparently I was too tired to take it seriously. Thanks for the correction! Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/
First
|
Prev
|
Pages: 1 2 Prev: less than sign for inheritance in classes Next: Persistent Instance Vars on Soap Server. |