Class: ConvenientService::Examples::Standard::Gemfile::Services::ReadFileContent

Inherits:
Object
  • Object
show all
Includes:
Service::Configs::Standard
Defined in:
lib/convenient_service/examples/standard/gemfile/services/read_file_content.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Service::Configs::Standard

service?, service_class?

Methods included from Config

included

Constructor Details

#initialize(path:) ⇒ ReadFileContent

Returns a new instance of ReadFileContent.



23
24
25
# File 'lib/convenient_service/examples/standard/gemfile/services/read_file_content.rb', line 23

def initialize(path:)
  @path = path
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



16
17
18
# File 'lib/convenient_service/examples/standard/gemfile/services/read_file_content.rb', line 16

def path
  @path
end

Instance Method Details

#resultObject



27
28
29
# File 'lib/convenient_service/examples/standard/gemfile/services/read_file_content.rb', line 27

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