From: gnana prasad Date: 2008-04-25T23:18:25+09:00 Subject: Re: How to override a method defined in Ruby module ------=_Part_1330_3667272.1209133103817 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Greetings Alex, *Overriding the metohd in a module* save this snippet of code as *sample.rb* file module Sample def display puts "Inside a mosdule" end end *write another file test.rb * require 'sample' class Test include Sample def display puts "Inside the class" end end Test.new.display # OUTPUT : Inside the class See here *display* method in the *class Test overrides *the *display*method in *Module Sample * On Mon, Apr 7, 2008 at 3:25 PM, Sonar Volta wrote: > Greetings, > > I'm new in Ruby, so my question might seem a bit stupid. I have a > third-party module wired into my project (ActiveScaffold). It defines > some empty method: > > [code] > module ActiveScaffold::Actions > > module Update > > ...... > > # override this method if you want to do something after the save > def after_update_save(record); end > > end > end > > [/code] > > which I need to override. How do I do this? > > Thanks in advance, > Alex > -- > Posted via http://www.ruby-forum.com/. > > ------=_Part_1330_3667272.1209133103817--