Sha256: 6651a01e1eb7c62432f663db75cfb8150ff262ddc4d720b812aa3e33af23fa6c

Contents?: true

Size: 336 Bytes

Versions: 12

Compression:

Stored size: 336 Bytes

Contents

module Kernel

  # Easy access to an object's "special" class,
  #
  # One day these names must be reconciled!

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

  # Deprecate?
  alias_method :singleton, :singleton_class

end

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
facets-2.8.3 lib/core/facets/kernel/singleton_class.rb
facets-2.8.2 lib/core/facets/kernel/singleton_class.rb
facets-2.8.1 lib/core/facets/kernel/singleton_class.rb
facets-2.8.0 lib/core/facets/kernel/singleton_class.rb
facets-2.7.0 lib/core/facets/kernel/singleton_class.rb
facets-2.6.0 lib/core/facets/kernel/singleton_class.rb
facets-2.4.4 lib/core/facets/kernel/singleton_class.rb
facets-2.5.1 lib/core/facets/kernel/singleton_class.rb
facets-2.4.5 lib/core/facets/kernel/singleton_class.rb
facets-2.5.0 lib/core/facets/kernel/singleton_class.rb
facets-2.5.2 lib/core/facets/kernel/singleton_class.rb
mack-facets-0.8.2 lib/gems/facets-2.4.5/lib/core/facets/kernel/singleton_class.rb