title: How do I call a super class method
body: <p>I have two classes <code>A</code>, and <code>B</code>. Class <code>B</code> overrides the <code>foo</code> method of class <code>A</code>. Class <code>B</code> has a <code>bar</code> method where I want to call the <code>foo</code> method of the super class. What is the syntax for such a call?</p>
  
  <pre><code>class A    
   def foo
     "hello"
   end    
  end
  
  
  class B &lt; A
   def foo
    super + " world"
   end
  
   def bar
     # how to call the `foo` method of the super class?
     # something similar to
     super.foo
   end
  end
  </code></pre>
  
  <p>For class methods I can call the methods up the inheritance chain by explicitly prefixing the class name. I wonder if there is a similar idiom for instance methods.</p>
  
  <pre><code>class P
   def self.x
     "x"
   end
  end
  
  class Q &lt; P
   def self.x
     super + " x"
   end
  
   def self.y
     P.x
   end
  end
  </code></pre>
  
  <p><strong>Edit</strong>
  My use case is general. For a specific case I know I can use <code>alias</code> technique. This is a common feature in Java or C++, so I am curious to know if it is possible to do this without adding extra code.</p>