Module: Singleton

Included in:
ActiveSupport::Deprecation
Defined in:
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 'lib/active_support/core_ext/object/duplicable.rb', line 57

def duplicable?
  false
end