title: Call parent method in child class
body: <p>I'm learning the object model of Ruby. I've written this script:</p>
  
  <pre><code>#/usr/bin/ruby
  
  module MyModule
  
    class MyBase
      def class_b_method
        puts "class_b_method called"
      end
    end
  
    class MyClass &lt; MyBase
      attr_accessor :name
  
      class_b_method
  
      def set_name(name)
        @name = "My name is #{name}"
      end
  
      def display_name
        return @name
      end    
    end   
  end
  
  obj = MyModule::MyClass.new
  obj.set_name "Martin"
  puts obj.display_name
  </code></pre>
  
  <p>Running the code above I get this error:</p>
  
  <pre><code>module.rb:13: undefined local variable or method `class_b_method' for MyModule::MyClass:Class (NameError)
  </code></pre>
  
  <p>I'm trying to call the parent method within the class <code>MyClass</code>. What I'm doing wrong?</p>