module RSpec::Support
def self.class_of(object)
- Api: - private
def self.class_of(object) object.class rescue NoMethodError singleton_class = class << object; self; end singleton_class.ancestors.find { |ancestor| !ancestor.equal?(singleton_class) } end