From: Peter Vandenabeele Date: 2011-12-11T07:01:55+09:00 Subject: Re: How to call a method from a different class --001485ee82ee721b7904b3c40c9d Content-Type: text/plain; charset=UTF-8 On Sat, Dec 10, 2011 at 10:47 PM, Darren H. wrote: > Hi all, > > I am currently stuck trying to call a method from a different class. > > example... > > I have a checkout class and within it I have the overall method, I want > to call the overall method from within the shopping class... > So that could be done like this. # caveat : untested code class Checkout def overall_instance_method "overall total on instance" end def class.overall_class_method "overall total on class" end end class Shopping def order # prepare order # with a Checkout instance checkout = Checkout.new puts checkout.overall_instance_method # with class method on Checkout puts Checkout.overall_class_method end end HTH, Peter --001485ee82ee721b7904b3c40c9d--