Sha256: 661c5056e4b2f769863b94f70d45281823d149928f170e7d08a0dca6f2408bec

Contents?: true

Size: 506 Bytes

Versions: 10

Compression:

Stored size: 506 Bytes

Contents

class Module

  private

  # Alias a module function so that the alias is also
  # a module function. The typical #alias_method
  # does not do this.
  #
  #   module Demo
  #     module_function
  #     def hello
  #       "Hello"
  #     end
  #   end
  #
  #   Demo.hello    #=> Hello
  #
  #   module Demo
  #     alias_module_function( :hi , :hello )
  #   end
  #
  #   Demo.hi       #=> Hello
  #
  def alias_module_function(new, old)
    alias_method(new, old)
    module_function(new)
  end

end

Version data entries

10 entries across 10 versions & 1 rubygems

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