Sha256: c806e75d2263f97e972c6ebba923e27c42c99966f344ef233a0349b098741ee1
Contents?: true
Size: 487 Bytes
Versions: 12
Compression:
Stored size: 487 Bytes
Contents
# From: http://jicksta.com/articles/2007/08/04/the-methodphitamine require 'blankslate' module Kernel def it() It.new end alias its it end class It < BlankSlate def initialize @methods = [] end def method_missing(*args, &block) @methods << [args, block] unless args == [:respond_to?, :to_proc] self end def to_proc lambda do |obj| @methods.inject(obj) do |current,(args,block)| current.send(*args, &block) end end end end
Version data entries
12 entries across 12 versions & 1 rubygems