Sha256: 7de1b461bdd58960b3fd25af58ea06a061b5810bab59f6120b9363a2abaa63b6
Contents?: true
Size: 700 Bytes
Versions: 1
Compression:
Stored size: 700 Bytes
Contents
# frozen_string_literal: true module ConvenientService module Examples module Standard module Gemfile module Services class AssertFileNotEmpty include ConvenientService::Standard::Config attr_reader :path def initialize(path:) @path = path end def result return failure(data: {path: "Path is `nil`"}) if path.nil? return failure(data: {path: "Path is empty"}) if path.empty? return error(message: "File with path `#{path}` is empty") if ::File.zero?(path) success end end end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
convenient_service-0.12.0 | lib/convenient_service/examples/standard/gemfile/services/assert_file_not_empty.rb |