123456789_123456789_123456789_123456789_123456789_

Module: Mongo::Operation::PolymorphicResult Private

Do not use. This module is for internal use only.
Relationships & Source Files
Namespace Children
Modules:
Extension / Inclusion / Inheritance Descendants
Included In:
Super Chains via Extension / Inclusion / Inheritance
Instance Chain:
Defined in: lib/mongo/operation/shared/polymorphic_result.rb

Overview

Shared behavior of instantiating a result class matching the operation class.

This module must be included after Executable module because result_class is defined in both.

Class Method Summary

Instance Method Summary

Class Method Details

.included(base) (private)

[ GitHub ]

  
# File 'lib/mongo/operation/shared/polymorphic_result.rb', line 33

def self.included(base)
  base.extend ClassMethods
end

Instance Method Details

#result_class

[ GitHub ]

  
# File 'lib/mongo/operation/shared/polymorphic_result.rb', line 41

def result_class
  self.class.result_class ||= begin
    polymorphic_class(self.class.name, :Result)
  rescue NameError
    polymorphic_class(self.class.name.sub(/::[^:]*$/, ''), :Result)
  end
end