Sha256: 8458ce8049d7e133877ce1c6f28946733736e96f326cb9ed14c2ca0bb8699a4d

Contents?: true

Size: 439 Bytes

Versions: 20

Compression:

Stored size: 439 Bytes

Contents

class Module

  private

  # Include module and apply module_fuction to the
  # included methods.
  #
  #   module Utils
  #     module_function
  #     def foo; "foo"; end
  #   end
  #
  #   module UtilsPlus
  #     include_function_module Utils
  #   end
  #
  # CREDIT: Trans

  def include_function_module *mod
    include(*mod)
    module_function(*mod.collect{|m| m.private_instance_methods & m.methods(false)}.flatten)
  end

end

Version data entries

20 entries across 19 versions & 2 rubygems

Version Path
facets-glimmer-3.2.0 lib/core/facets/module/include_function_module.rb
facets-3.1.0 lib/core/facets/module/include_function_module.rb
facets-3.0.0 lib/core/facets/module/include_function_module.rb
facets-2.9.3 lib/core/facets/module/include_function_module.rb
facets-2.9.2 lib/core/facets/module/include_function_module.rb
facets-2.9.2 src/core/facets/module/include_function_module.rb
facets-2.9.1 lib/core/facets/module/include_function_module.rb
facets-2.9.0 lib/core/facets/module/include_function_module.rb
facets-2.9.0.pre.2 lib/core/facets/module/include_function_module.rb
facets-2.9.0.pre.1 lib/core/facets/module/include_function_module.rb
facets-2.8.4 lib/core/facets/module/include_function_module.rb
facets-2.8.3 lib/core/facets/module/include_function_module.rb
facets-2.8.2 lib/core/facets/module/include_function_module.rb
facets-2.8.1 lib/core/facets/module/include_function_module.rb
facets-2.8.0 lib/core/facets/module/include_function_module.rb
facets-2.7.0 lib/core/facets/module/include_function_module.rb
facets-2.6.0 lib/core/facets/module/include_function_module.rb
facets-2.5.1 lib/core/facets/module/include_function_module.rb
facets-2.5.0 lib/core/facets/module/include_function_module.rb
facets-2.5.2 lib/core/facets/module/include_function_module.rb