Sha256: dc7af091c7da0d2f5b1d67a9b36570e3e84cdb0271dfac3d9fb49ff4dc7fe186
Contents?: true
Size: 675 Bytes
Versions: 12
Compression:
Stored size: 675 Bytes
Contents
module Finitio class ProcWithCode < Proc def self.new(*args, &bl) return Proc.new(*args, &bl) unless args.size == 2 && bl.nil? p = Kernel.eval("->(#{args.first}){ #{args.last} }") p.instance_variable_set(:@_finitio_src, args) def p.finitio_src @_finitio_src end def p.hash @_finitio_src.hash end def p.==(other) super || ( other.is_a?(Proc) && other.respond_to?(:finitio_src) && other.finitio_src == self.finitio_src ) end def p.eql?(other) self.==(other) end p end end # module ProcWithCode end # module Finitio
Version data entries
12 entries across 12 versions & 1 rubygems