title: Why is_a? returns false for Hash class?
body: <p>Why <code>is_a?</code> returns <code>false</code> for a <code>Hash</code> class?</p>
  
  <p>Example:    </p>
  
  <pre><code>value = {"x" =&gt; 3, "y" =&gt; 2}
  
  puts value.class
  puts value.is_a?(Hash)
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>Hash
  false
  </code></pre>
  
  <p>Im using Ruby 1.9.2</p>
  
  <p><strong>UPDATED</strong>: full source of my class:</p>
  
  <pre><code>class LatLng
    include Mongoid::Fields::Serializable
  
    attr_reader :lat, :lng
  
    def serialize(value)
      return if value.nil?
  
      puts value.class
      puts value.is_a?(Hash)
  
      if value.is_a?(self.class)
        puts "is geopoint" + value.to_json
        {'lng' =&gt; value.lng.to_f, 'lat' =&gt; value.lat.to_f}
      elsif value.is_a?(Hash)
        hash = value.with_indifferent_access
        puts "is hash" + value.to_json
        {'lng' =&gt; hash['lng'].to_f, 'lat' =&gt; hash['lat'].to_f}
      end
    end
  
    def deserialize(value)
      return if value.nil?
  
      value.is_a?(self.class) ? value : LatLng.new(value['lat'], value['lng'])
    end
  
    def initialize(lat, lng)
      @lat, @lng = lat.to_f, lng.to_f
    end
  
    def [](arg)
      case arg
        when "lat"
          @lat
        when "lng"
          @lng
      end
    end
  
    def to_a
      [lng, lat]
    end
  
    def ==(other)
      other.is_a?(self.class) &amp;&amp; other.lat == lat &amp;&amp; other.lng == lng
    end
  end
  </code></pre>