Sha256: 14da6d684eb2c3a985729e20863977a9886fac8177bd3213b9f1e296c791ec85

Contents?: true

Size: 322 Bytes

Versions: 11

Compression:

Stored size: 322 Bytes

Contents

class Proc
  # @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

11 entries across 11 versions & 1 rubygems

Version Path
em-midori-0.1.6.1 lib/midori/core_ext/proc.rb
em-midori-0.1.6 lib/midori/core_ext/proc.rb
em-midori-0.1.5.4 lib/em-midori/core_ext/proc.rb
em-midori-0.1.5.3 lib/em-midori/core_ext/proc.rb
em-midori-0.1.5.2 lib/em-midori/core_ext/proc.rb
em-midori-0.1.5.1 lib/em-midori/core_ext/proc.rb
em-midori-0.1.5 lib/em-midori/core_ext/proc.rb
em-midori-0.1.4.1 lib/em-midori/core_ext/proc.rb
em-midori-0.1.4 lib/em-midori/core_ext/proc.rb
em-midori-0.1.3 lib/em-midori/core_ext/proc.rb
em-midori-0.1.2 lib/em-midori/core_ext/proc.rb