From: Michael Guterl Date: 2006-08-16T03:20:27+09:00 Subject: Instance and Related Class Methods I have a class with a lot of instance methods which are related to class methods from within the same class. Example: class A def initialize(start_date, end_date) @start_date, @end_date = start_date, end_date end def total_hours A.total_hours(@start_date, @end_date) end def self.total_hours(start_date, end_date) self.sum(:hours, :conditions => between(start_date, end_date)) end def total_incoming A.total_incoming(@start_date, @end_date) end def self.total_incoming(start_date, end_date) self.sum(:incoming, :conditions => between(start_date, end_date)) end def total_outgoing A.total_outgoing(@start_date, @end_date) end def self.total_outgoing(start_date, end_date) self.sum(:outgoing, :conditions => between(start_date, end_date)) end end Everything works as expected. However, I am wondering if there is a more Rubyish way of accomplishing this so I can avoid the repetition. Any other suggestions are welcome. Thanks in advance. Michael Guterl