From: Jason Vogel Date: 2006-12-09T03:15:08+09:00 Subject: Re: Module issue Sweet, that works. Thanks Vincent and Stefano, Jason On Dec 8, 12:02 pm, Stefano Crocco wrote: > Alle 18:55, venerd� 8 dicembre 2006, Jason Vogel ha scritto: > > > > > I plan move the "require" up top, once I've got my stuff straight. > > > Okay, I needed the "self." in the Module def. > > > < in ahs.rb > > > module Ahs > > class CreditCard > > def self.test2 > > puts "\n\nself.CreditCard.test2 fired\n\n" > > end > > end > > def self.test > > puts "\n\nself.test fired\n\n" > > end > > end > > > < in offer_renewal_controller.rb > > > Ahs.test > > Ahs.CreditCard.test2 > > > Result: > > self.test fired > > undefined method `CreditCard' for Ahs:Module [exception thrown] > > > What's wrong with the second statement?You should use Ahs::CreditCard, not Ahs.CreditCard. The . syntax is used to > call module methods; the :: is used to access constants defined in a module > (including classes).