Module: Singleton

Included in:
ActionDispatch::ServerTiming::Subscriber, ActiveJob::Serializers::ObjectSerializer, ActiveModel::NullMutationTracker, Mime::AllType, Mime::NullType
Defined in:
activesupport/lib/active_support/core_ext/object/duplicable.rb

Instance Method Summary collapse

Instance Method Details

#duplicable?Boolean

Singleton instances are not duplicable:

Class.new.include(Singleton).instance.dup # TypeError (can't dup instance of singleton

Returns:

  • (Boolean)


57
58
59
# File 'activesupport/lib/active_support/core_ext/object/duplicable.rb', line 57

def duplicable?
  false
end