Sha256: b0995d9b667e80f13ddece51379219499d6dc30641ff1c3a49d06d1dc2057104
Contents?: true
Size: 480 Bytes
Versions: 31
Compression:
Stored size: 480 Bytes
Contents
## # Meta-programming Proc for Syntactic Sugars class Proc # Convert [Proc] to [Lambda] # @param [Object] instance the context # @return [Lambda] Lambda converted # @note Converting [Proc] to [Lambda] may have incorrect behaviours on corner cases. # @note See {Ruby Language Issues}[https://bugs.ruby-lang.org/issues/7314] for more details. def to_lambda(instance = Object.new) instance.define_singleton_method(:_, &self) instance.method(:_).to_proc end end
Version data entries
31 entries across 31 versions & 2 rubygems