Sha256: cc61e43b10d6e4323c449df220cabacbf07a0a6dc8ca473f2a5fd29b22950e6d

Contents?: true

Size: 337 Bytes

Versions: 5

Compression:

Stored size: 337 Bytes

Contents

class Module

  # Prepend an +aspect+ module to a module.
  #
  #   module X
  #     def x; "x"; end
  #   end
  #
  #   module U
  #     def x; '{' + super + '}'; end
  #   end
  #
  #   X.prepend U
  #
  #   X.x  # => "{x}"
  #
  #  CREDIT Trans

  def prepend(aspect)
    aspect.__send__(:include, self)
    extend aspect
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
facets-2.4.0 lib/facets/module/prepend.rb
facets-2.4.1 lib/facets/module/prepend.rb
facets-2.4.2 lib/core/facets/module/prepend.rb
facets-2.4.3 lib/core/facets/module/prepend.rb
facets-2.4.4 lib/core/facets/module/prepend.rb