Sateesh Kambhamapati wrote:
> i would like to know which methods are called by class object i.e

Not sure what you mean by "called by class object"

> Question : --> My Question is i would like to know which methods are 
> called by object i.e flowerlist  in the class Flower
> 
> if i already know those methods then
> suppose if i have not define some method then i will define it 
> dynamically example here is "lotus"

If you want to intercept *all* calls to the object, then put a proxy 
object in front of it, and delegate the calls (e.g. see 
SimpleDelegator).

If you're happy to intercept only the unknown methods (which you will 
then define), then method_missing is what you want.

class Flower
  def jasmine
    puts "I am jasmine"
  end
  def method_missing(meth,*args,&blk)
    puts "method #{meth.inspect} called with #{args.inspect}"
  end
end
flowerlist=Flower.new
flowerlist.jasmine        # I am jasmine
flowerlist.lotus          # method :lotus called with []
-- 
Posted via http://www.ruby-forum.com/.