Greg Hauptmann
2008-Sep-20 05:50 UTC
how do I call "super" if I over-ride a plugins method???
Hi, I want to override a method in a plugin (which itself is a method that when the plugin loads adds them via a mixin technique). I want to add a blank copy of this method outside the plugin (say in /lib/xx_extns.rb), HOWEVER how do I in my method call the plugin method first before doing my stuff? Super, doesn''t work as I''m not sub-classing., Thanks in advance On 9/17/08, Greg Hauptmann <greg.hauptmann.ruby-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, > > I know how to use Rails debugging via entering a "debugger" statement. > > Question - Is there a way however to drop into the debugger mode after > an exception has occurred? and effectively back back one step just > prior to the exception occurs, and then you can query the variables > etc. That is then a way to (a) drop from "script/server" mode to > "debugger" shell, and (b) go back to the point just before the > exception? > > Thanks in advance >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Erol Fornoles
2008-Sep-20 06:53 UTC
Re: how do I call "super" if I over-ride a plugins method???
On Sep 20, 1:50 pm, "Greg Hauptmann" <greg.hauptmann.r...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, > > I want to override a method in a plugin (which itself is a method that > when the plugin loads adds them via a mixin technique). > > I want to add a blank copy of this method outside the plugin (say in > /lib/xx_extns.rb), HOWEVER how do I in my method call the plugin > method first before doing my stuff? > > Super, doesn''t work as I''m not sub-classing., > > Thanks in advanceYou chain the method by calling alias_method before "overriding" it. You then call the name of the "aliased" method from your method. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---