Class: Module

Inherits:
Object
  • Object
show all
Defined in:
lib/contracts/core_ext.rb

Instance Method Summary collapse

Instance Method Details

#singleton_classObject

Compatibility with ruby 1.8



4
5
6
# File 'lib/contracts/core_ext.rb', line 4

def singleton_class
  class << self; self; end
end

#singleton_class?Boolean

Compatibility with ruby 1.8

Returns:

  • (Boolean)


11
12
13
# File 'lib/contracts/core_ext.rb', line 11

def singleton_class?
  self <= Object.singleton_class
end