class Anaphora::Proxy

Public Class Methods

new() click to toggle source
# File lib/anaphora.rb, line 14
def initialize
  @methods = []
end

Public Instance Methods

method_missing(name, *args, &block) click to toggle source
# File lib/anaphora.rb, line 22
def method_missing(name, *args, &block)
  return true if name == :respond_to? && args.first == :to_proc
  @methods << MethodInvocation.new(name, args, block)
  self
end
to_proc() click to toggle source
# File lib/anaphora.rb, line 18
def to_proc
  lambda {|it| @methods.inject(it) {|target, method| method.send_to(target) }}
end