Sha256: 2ba28bdf5f309be8ee9a210212178e507dec938ed304a75f9c1f5e68fa3a6ef5

Contents?: true

Size: 279 Bytes

Versions: 5

Compression:

Stored size: 279 Bytes

Contents

module Kernel

  # Alias a method defined in the metaclass (ie. singleton class).
  #
  #   def X.y?; "y?" ; end
  #   X.meta_alias "ynot?", "y?"
  #   X.ynot?  #=> y?
  #
  # CREDIT: Trans

  def meta_alias(*args)
    meta_class do
      alias_method(*args)
    end
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

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