Sha256: d139c0793df6513d9a15de10ae70bef1b5d5b00d95bce4e05a68f4fcf7841cef

Contents?: true

Size: 315 Bytes

Versions: 10

Compression:

Stored size: 315 Bytes

Contents

module Kernel

  # Easy access to an object qua class, otherwise
  # known as the object's singleton class.
  #
  # Yes, another one.
  #
  # CREDIT: Trans

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

end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
facets-2.8.4 lib/core/facets/kernel/qua_class.rb
facets-2.8.3 lib/core/facets/kernel/qua_class.rb
facets-2.8.2 lib/core/facets/kernel/qua_class.rb
facets-2.8.1 lib/core/facets/kernel/qua_class.rb
facets-2.8.0 lib/core/facets/kernel/qua_class.rb
facets-2.7.0 lib/core/facets/kernel/qua_class.rb
facets-2.6.0 lib/core/facets/kernel/qua_class.rb
facets-2.5.1 lib/core/facets/kernel/qua_class.rb
facets-2.5.0 lib/core/facets/kernel/qua_class.rb
facets-2.5.2 lib/core/facets/kernel/qua_class.rb