title: Ruby print out only the class methods (and not inherited methods)
body: <p>I wish to only print out the methods that are declared in the class. This does the trick:</p>
  <pre class="lang-rb prettyprint-override"><code>p (
    Float.instance_methods - 
    Object.instance_methods - 
    Numeric.instance_methods
    ).count
  
  p (
    Float.instance_methods - 
    Object.instance_methods - 
    Numeric.instance_methods
    )
  
  STDOUT:
  12
  [:+, :-, :*, :/, :**, :to_f, :to_i, :nan?, :infinite?, :finite?, :to_r, :rationalize]
  </code></pre>
  <p>But isn't there an easier way to get these methods?</p>
  <hr />
  <p>bonus info</p>
  <pre class="lang-rb prettyprint-override"><code>p Float.methods.count # 117
  
  p Float.instance_methods.count # 126
  
  p Float.class.methods.count # 120
  </code></pre>