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

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Config

included

Constructor Details

#initialize(path:) ⇒ ReadFileContent

Returns a new instance of ReadFileContent.



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

def initialize(path:)
  @path = path
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



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

def path
  @path
end

Instance Method Details

#resultObject



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

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