title: ruby: use module include in instance method of class
body: <p>Have a look at the code below</p>
  
  <pre><code>initshared.rb
  module InitShared
    def init_shared
      @shared_obj = "foobar"
    end
  end
  </code></pre>
  
  <p>myclass.rb</p>
  
  <pre><code>class MyClass
    def initialize()
    end
    def init
      file_name = Dir.pwd+"/initshared.rb"
      if File.file?(file_name)
        require file_name
        include InitShared
        if self.respond_to?'init_shared'
          init_shared
          puts @shared_obj
        end
      end
    end
  end
  </code></pre>
  
  <p>The include InitShared dosn't work since its inside the method .</p>
  
  <p>I want to check for the file and then include the module and then access the variables in that module.</p>