Sha256: a63ec9c897513e39bb1e73556ec0f710bee11c43643deb93db90af84c15d89d0

Contents?: true

Size: 321 Bytes

Versions: 5

Compression:

Stored size: 321 Bytes

Contents

module Kernel

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

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

  alias_method :metaclass, :meta_class

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
facets-2.8.4 lib/core/facets/kernel/meta_class.rb
facets-2.8.3 lib/core/facets/kernel/meta_class.rb
facets-2.8.2 lib/core/facets/kernel/meta_class.rb
facets-2.8.1 lib/core/facets/kernel/meta_class.rb
facets-2.8.0 lib/core/facets/kernel/meta_class.rb