 <p>The reason why <code>respond_to?(:say_hello)</code> is returning <code>false</code> is due to the fact <code>class A</code> has <code>say_hello</code> as instance method and since you are extending <code>class B</code> the <code>create_say_hello_if_not_exists</code> is declared as class method and it does not find <code>say_hello</code>. </p> <p>Changing the code to the following would do the trick. I'm declaring <code>say_hello</code> in <code>class A</code> as class method and am calling it in a static manner.</p> <pre> module B def create_say_hello_if_not_exists puts respond_to?(:say_hello) define_method :say_hello do puts 'hello' end unless respond_to?(:say_hello) end end class A def self.say_hello puts 'hi' end extend B create_say_hello_if_not_exists end A.say_hello </pre>