class It

Public Class Methods

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

Public Instance Methods

method_missing(*args, &block) click to toggle source
# File lib/vendor/methodphitamine.rb, line 15
def method_missing(*args, &block)
  @methods << [args, block] unless args == [:respond_to?, :to_proc]
  self
end
to_proc() click to toggle source
# File lib/vendor/methodphitamine.rb, line 20
def to_proc
  ::Kernel.lambda do |obj|
    @methods.inject(obj) { |current, (args,block)| current.send(*args, &block) }
  end
end