Sha256: 8f664908fa7bf4f54522d91510353687a3f85673336fd50fc313495a802863e8
Contents?: true
Size: 379 Bytes
Versions: 10
Compression:
Stored size: 379 Bytes
Contents
class Class # Convert instatiation of a class into a Proc. # # class Person # def initialize(name) # @name = name # end # # def inspect # @name.to_str # end # end # # %w(john bob jane hans).map(&Person) => [john, bob, jane, hans] # # CREDIT: Daniel Schierbeck def to_proc proc{|*args| new(*args)} end end
Version data entries
10 entries across 10 versions & 1 rubygems