File: yield_self.rb

package info (click to toggle)
ruby-backports 3.25.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,912 kB
  • sloc: ruby: 11,759; makefile: 6
file content (6 lines) | stat: -rw-r--r-- 148 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
module Kernel
  def yield_self
    return to_enum(__method__) { 1 } unless block_given?
    yield self
  end unless method_defined? :yield_self
end