Sha256: d43bdddaee1606968504d0df99cfa6aa90f7afaaf4ce7029bdcd7172422991e6

Contents?: true

Size: 276 Bytes

Versions: 4

Compression:

Stored size: 276 Bytes

Contents

module Kernel

  # Easy access to an object's "special" class,
  # otherwise known as it's eigen or meta class.

  def singleton_class(&block)
    if block_given?
      (class << self; self; end).class_eval(&block)
    else
      (class << self; self; end)
    end
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
facets-2.4.0 lib/facets/kernel/singleton_class.rb
facets-2.4.1 lib/facets/kernel/singleton_class.rb
facets-2.4.2 lib/core/facets/kernel/singleton_class.rb
facets-2.4.3 lib/core/facets/kernel/singleton_class.rb