From: Tristin Davis Date: 2008-06-15T07:00:52+09:00 Subject: alias throwing exception: undefined method `send_mail' for class `HeartBeat' (NameError) ------=_Part_14620_2693346.1213480897439 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline I'm having a problem with the code below. when I try and alias the send_mail method, it throws an exception. undefined method `send_mail' for class `HeartBeat' (NameError) Any help would be appreciated. :) class Heartbeat alias :win_mail :send_mail if RUBY_PLATFORM =~ /mswin32/ alias :unix_mail :send_mail if RUBY_PLATFORM =~ /linux/ #Abstract method def send_mail raise RuntimeError, "Could not detect OS" end private # in: hash=> subject, body, recipients # out: true if successful def win_mail(opts={}) require 'win32ole' outlook = WIN32OLE.new('Outlook.Application') message = outlook.CreateItem(0) message.Subject = opts[:subject] message.Body = opts[:body] message.To = opts[:recipients] message.Send end def unix_mail(opts={}) end end ------=_Part_14620_2693346.1213480897439--