Sha256: c5869d6f03247501fa23119a85fc703006700ce8265c73e2200900865f8f0514
Contents?: true
Size: 424 Bytes
Versions: 26
Compression:
Stored size: 424 Bytes
Contents
module Kernel # A nice shorthand for lambda. # # adder = fn { |x,y| x + y } # adder[1,2] #=> 3 # alias_method( :fn, :lambda ) end # _____ _ # |_ _|__ ___| |_ # | |/ _ \/ __| __| # | | __/\__ \ |_ # |_|\___||___/\__| # =begin test require 'test/unit' class TCKernel < Test::Unit::TestCase def test_fn assert_instance_of(Proc, fn{ |x| x + 1 } ) end end =end
Version data entries
26 entries across 26 versions & 1 rubygems