Sha256: aeebb094bf129a6fb263806d1bd5e918df13a8280d0bf46204d8548ee630e2b3
Contents?: true
Size: 686 Bytes
Versions: 14
Compression:
Stored size: 686 Bytes
Contents
# frozen_string_literal: true module ConvenientService module Examples module Standard module Gemfile module Services class AssertFileExists include ConvenientService::Standard::Config attr_accessor :path def initialize(path:) @path = path end def result return failure(path: "Path is `nil`") if path.nil? return failure(path: "Path is empty") if path.empty? return error("File with path `#{path}` does NOT exist") unless ::File.exist?(path) success end end end end end end end
Version data entries
14 entries across 14 versions & 1 rubygems