Sha256: c580425d4b584db6b515596d79f02f4c3a4c00d40c37402e88cd5e4390058e29

Contents?: true

Size: 711 Bytes

Versions: 4

Compression:

Stored size: 711 Bytes

Contents

# frozen_string_literal: true

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

            attribute :path, :string

            validates :path, presence: true if ConvenientService::Dependencies.support_has_j_send_result_params_validations_using_active_model_validations?

            step Services::AssertFileExists, in: :path
            step Services::AssertFileNotEmpty, in: :path
            step :result, in: :path, out: :content

            def result
              success(content: ::File.read(path))
            end
          end
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
convenient_service-0.17.0 lib/convenient_service/examples/rails/gemfile/services/read_file_content.rb
convenient_service-0.16.0 lib/convenient_service/examples/rails/gemfile/services/read_file_content.rb
convenient_service-0.15.0 lib/convenient_service/examples/rails/gemfile/services/read_file_content.rb
convenient_service-0.14.0 lib/convenient_service/examples/rails/gemfile/services/read_file_content.rb