From: salamond Date: 2011-10-19T22:16:06+09:00 Subject: inheritance in ruby Hi, all. I'm creating an automation framework, and met this inheritance private/protected problem. Say I'm having SshCon and LinuxSshCon class SshCon def connect cmd() end def cmd end def search cmd("") end end class LinuxSshCon < SshCon def cmd format() super() end end lsc = LinuxSshCon.new lsc.connect # here it would use the cmd in LinuxSshCon, and cause me some trouble lsc.cmd My problem is this: When I overwrite a method in sub class, is there a way I can keep the original class calling its own method? I tried def connect self.cmd end or use private/protected to claim cmd, none of them works thanks JarodZZ