module Mongo::Operation::PolymorphicResult
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.
@api private
Private Class Methods
included(base)
click to toggle source
# File lib/mongo/operation/shared/polymorphic_result.rb, line 30 def self.included(base) base.extend ClassMethods end
Private Instance Methods
result_class()
click to toggle source
# File lib/mongo/operation/shared/polymorphic_result.rb, line 38 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