### Home Classes Methods

### In Files

- lib/facets/method/memoize.rb
- lib/facets/method/composition.rb

### Parent

Object

### Namespace

- CLASS Method::Composition

### Methods

- #*
- #^
- #memoize

### Files

- README.rdoc

### Class/Module Index

Quicksearch

- Lazy
- Lazy::Future
- Lazy::Promise
- Lazy::Promise::DIVERGES
- Lazy::PromiseSafe
- Enumerable
- Enumerable::Recursor
- Method
- Method::Composition
- Module
- Module::InstanceFunction
- Array
- Binding
- Class
- Comparable
- Denumerable
- Denumerator
- Dir
- Enumerator
- Exception
- Facets
- FalseClass
- File
- FileTest
- Fixnum
- Float
- Functor
- Hash
- Indexable
- Instance
- Integer
- Kernel
- MatchData
- NA
- NilClass
- Numeric
- Object
- ObjectSpace
- Proc
- Process
- Range
- Regexp
- String
- Struct
- Symbol
- Time
- TrueClass
- UnboundMethod

No matching classes.

# Method

### Public Instance Methods

*(g) click to toggle source

Method composition.

@author Mike Burns

    # File lib/facets/method/composition.rb, line 65
    def *(g)
      Composition.new(self, g)
    end

^(n) click to toggle source

Method repetition.

@author Mike Burns

    # File lib/facets/method/composition.rb, line 72
    def ^(n)
      if n < 2
        self
      else
        Composistion.new(self, self ^ (n-1))
      end
    end

memoize(value) click to toggle source

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/facets/method/memoize.rb, line 11
    def memoize(value)
      singleton = (class << receiver; self; end)
      singleton.__send__(:define_method, name){ value }
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.