# class 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