title: Calling Methods from Inherited Class in Ruby
body: <p>I have the following classes:</p>
  
  <p>Module</p>
  
  <pre><code>module AlertService
      module MessageTemplate
        def generate_message
          "test"
        end
      end
    end
  </code></pre>
  
  <p>Parent class:</p>
  
  <pre><code>module Client
    def post uri, params={}
      Net::HTTP.post_form uri, params
    end
  end
  
  module AlertService
    class BaseAlert
      extend MessageTemplate
      include Singleton
      include Client
      def initialize; end
    end
  end
  </code></pre>
  
  <p>Child Class:</p>
  
  <pre><code>module AlertService
  class TestAlert &lt; BaseAlert
    include Singleton
    def initialize
    options = {
      username: "Screen Alert Bot",
      http_client: Client
    }
    @notifier = Slack::Notifier.new(rails.config.url, options)
    end
  
    def self.create_message
      message = generate_message
    end
  
    def self.send_message
      create_message
      @notifier.post blocks: message
    end
  end
  end
  </code></pre>
  
  <p>I can create the test alert like this: <code>s= AlertService::TestAlert</code></p>
  
  <p>But I get the error when I do this:</p>
  
  <p>s.send_message</p>
  
  <pre><code>NoMethodError: undefined method `generate_message' for AlertService::TestAlert::Class
  </code></pre>
  
  <p>generate_message is a method from the MessageTemplate module included in the BaseAlert class. Why is it saying my inherited class doesn't have access to the method? </p>