title: Objects Extending Scala traits. Ruby equivalent?
body: <p>In Scala I can write a singleton Object that implements a trait. </p>
  
  <pre><code>trait Greeter {
    def greet = "Hello"
  }
  object MyGreeterObject extends Greeter
  </code></pre>
  
  <p>Then I can mock Greeter in my tests really easily</p>
  
  <pre><code>var mockGreeter = new Greeter { 
    override def greet = "I'm a mock"
  }
  </code></pre>
  
  <p>Is there an equivalent way of doing this in Ruby? Ultimately I want to be able to mock some methods that do not need state and are best served (in Scala anyway) by an object level method. And once I have this I want to be able to have a mock for my tests.</p>