title: Adding Methods to String In a Namespace
body: <p>I'm defining some new methods on <code>String</code>. I need to be sure these methods do not conflict with methods defined in other libraries (for reference, I created an inflector and then added <code>pluralize</code> and <code>singularize</code> onto <code>String</code>).</p>
  
  <p>My first thought was to wrap the new stuff in a module like so:</p>
  
  <pre><code>module MM
    class String
      def rev
        self.split('').reverse.join('')
      end
    end
  end
  
  class Test
    include MM
  
    def me(s)
      s.rev
    end
  end
  
  puts Test.new.me('this is a test')
  </code></pre>
  
  <p>but of course this doesn't work. <code>String#rev</code> remains undefined. What I really have in my code is a module <code>MM</code> and everything except the built-in type extensions is wrapped in <code>MM</code>. My goal is to have <code>String</code> have methods like <code>rev</code>, <code>singularize</code> and <code>pluralize</code> but only inside that module, <code>MM</code>.</p>
  
  <p>This seems like it ought to be doable. But somehow I'm missing the secret incantation that will make it so.</p>
  
  <p>If anyone can offer some suggestions it would be much appreciated.</p>