### Home Classes Methods

### In Files

- lib/facets/method/composition.rb

### Parent

Object

### Methods

- ::new
- #*
- #[]
- #^
- #arity
- #call
- #inspect
- #owner
- #receiver
- #to_proc

### 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::Composition

Method Composition class acts a proxy for composed methods.

@author Mike Burns

### Public Class Methods

new(f,g) click to toggle source

    # File lib/facets/method/composition.rb, line 9
    def initialize(f,g)
      @f = f
      @g = g
    end

### Public Instance Methods

*(h) click to toggle source

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

[](*x) click to toggle source

    # File lib/facets/method/composition.rb, line 56
    def [](*x)
      call(*x)
    end

^(n) click to toggle source

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

arity() click to toggle source

    # File lib/facets/method/composition.rb, line 41
    def arity
      @g.arity
    end

call(x) click to toggle source

    # File lib/facets/method/composition.rb, line 51
    def call(x)
      @f.call(*@g.call(*x))
    end

inspect() click to toggle source

    # File lib/facets/method/composition.rb, line 36
    def inspect
      "#<Method::Composition: #{@f.inspect} * #{@g.inspect}>"
    end

owner() click to toggle source

    # File lib/facets/method/composition.rb, line 26
    def owner
      @g.owner
    end

receiver() click to toggle source

    # File lib/facets/method/composition.rb, line 31
    def receiver
      @g.receiver
    end

to_proc() click to toggle source

    # File lib/facets/method/composition.rb, line 46
    def to_proc
      Proc.new {|x| @f.call(*@g.call(*x)) }
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.