123456789_123456789_123456789_123456789_123456789_

Module: Singleton::SingletonInstanceMethods

Relationships & Source Files
Extension / Inclusion / Inheritance Descendants
Included In:
Defined in: lib/singleton.rb

Instance Method Summary

  • #_dump(depth = -1))

    By default, do not retain any state when marshalling.

  • #clone

    Raises a TypeError to prevent cloning.

  • #dup

    Raises a TypeError to prevent duping.

Instance Method Details

#_dump(depth = -1))

By default, do not retain any state when marshalling.

[ GitHub ]

  
# File 'lib/singleton.rb', line 109

def _dump(depth = -1)
  ''
end

#clone

Raises a TypeError to prevent cloning.

Raises:

  • (TypeError)
[ GitHub ]

  
# File 'lib/singleton.rb', line 99

def clone
  raise TypeError, "can't clone instance of singleton #{self.class}"
end

#dup

Raises a TypeError to prevent duping.

Raises:

  • (TypeError)
[ GitHub ]

  
# File 'lib/singleton.rb', line 104

def dup
  raise TypeError, "can't dup instance of singleton #{self.class}"
end