Sha256: df0534661d3f0e7795e68b9543fa568f3cc851de88bdbf8832113a3e60840bb2
Contents?: true
Size: 437 Bytes
Versions: 3
Compression:
Stored size: 437 Bytes
Contents
# frozen_string_literal: true class Pathname # Returns the receiver if the named file exists otherwise returns +nil+. # <tt>pathname.existence</tt> is equivalent to # # pathname.exists? ? pathname : nil # # For example, something like # # content = pathname.read if pathname.exist? # # becomes # # content = pathname.existence&.read # # @return [Pathname] def existence self if exist? end end
Version data entries
3 entries across 3 versions & 1 rubygems