Sha256: 2ea7afe711cffce8674ced8a8dae5fb5779d424ca62c621bff0487f358a82951

Contents?: true

Size: 507 Bytes

Versions: 3

Compression:

Stored size: 507 Bytes

Contents

# frozen_string_literal: true

module ConvenientService
  module Examples
    module Rails
      module Gemfile
        module Services
          class AssertFileNotEmpty
            include RailsService::Config

            attribute :path, :string

            validates :path, presence: true

            def result
              return error(message: "File with path `#{path}` is empty") if ::File.zero?(path)

              success
            end
          end
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
convenient_service-0.2.1 lib/convenient_service/examples/rails/gemfile/services/assert_file_not_empty.rb
convenient_service-0.2.0 lib/convenient_service/examples/rails/gemfile/services/assert_file_not_empty.rb
convenient_service-0.1.0 lib/convenient_service/examples/rails/gemfile/services/assert_file_not_empty.rb