title: What does IRB use to determine how to represent a returned instance?
body: <p>Given a Ruby class:</p>
  
  <pre><code>class Foo
    def initialize(options={})
      @sensitive = options.delete :sensitive
    end
  end
  </code></pre>
  
  <p>If I create an instance of that class in IRB, I get to see instance vars and memory address.</p>
  
  <pre><code>irb(main):002:0&gt; Foo.new(sensitive: 'foo')
  =&gt; #&lt;Foo:0x007fe766134a98 @sensitive="foo"&gt;
  </code></pre>
  
  <p>If I create an instance of AWS::S3, I don't:</p>
  
  <pre><code>irb(main):003:0&gt; require 'aws-sdk'
  =&gt; true
  irb(main):004:0&gt; AWS::S3.new(access_key_id: 'aki', secret_access_key: 'sak')
  =&gt; &lt;AWS::S3&gt;
  </code></pre>
  
  <p>Note that <code>AWS::S3</code> is not a singleton (at least not in the sense of <a href="http://ruby-doc.org/stdlib-2.0.0/libdoc/singleton/rdoc/Singleton.html" rel="nofollow">explicitly including the Singleton module</a>).</p>
  
  <p>Is there anything I can do to tell IRB not to output instance vars and/or memory address?</p>
  
  <p>(I've already tried <code>.to_s</code> but I get a string containing the memory address for instances of both classes without any instance vars.)</p>