Sha256: 8439c97a3c873bc33c829f5d66da2947557433ecd4cf100d083250bc89b8114c
Contents?: true
Size: 456 Bytes
Versions: 45
Compression:
Stored size: 456 Bytes
Contents
# frozen_string_literal: true require "pathname" class Pathname # Returns the receiver if the named file exists otherwise returns +nil+. # <tt>pathname.existence</tt> is equivalent to # # pathname.exist? ? 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
45 entries across 45 versions & 8 rubygems