Method composition.
@author Mike Burns
# File lib/core/facets/method/composition.rb, line 65 def *(g) Composition.new(self, g) end
Method repetition.
@author Mike Burns
# File lib/core/facets/method/composition.rb, line 72 def ^(n) if n < 2 self else Composistion.new(self, self ^ (n-1)) end end
Memoize a method by defining a singleton override.
NOTE: This method is not a common core extension and is not loaded automatically when using require 'facets'.
@uncommon
require 'facets/method/memoize'
# File lib/core/facets/method/memoize.rb, line 11 def memoize(value) singleton = (class << receiver; self; end) singleton.__send__(:define_method, name){ value } end
Generated with the Darkfish Rdoc Generator 2.