Class: ConvenientService::Examples::Standard::V1::Gemfile::Services::ReadFileContent
- Inherits:
-
Object
- Object
- ConvenientService::Examples::Standard::V1::Gemfile::Services::ReadFileContent
- Includes:
- Service::Configs::Standard::V1
- Defined in:
- lib/convenient_service/examples/standard/v1/gemfile/services/read_file_content.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
-
#initialize(path:) ⇒ ReadFileContent
constructor
A new instance of ReadFileContent.
- #result ⇒ Object
Constructor Details
#initialize(path:) ⇒ ReadFileContent
Returns a new instance of ReadFileContent.
19 20 21 |
# File 'lib/convenient_service/examples/standard/v1/gemfile/services/read_file_content.rb', line 19 def initialize(path:) @path = path end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
12 13 14 |
# File 'lib/convenient_service/examples/standard/v1/gemfile/services/read_file_content.rb', line 12 def path @path end |
Instance Method Details
#result ⇒ Object
23 24 25 |
# File 'lib/convenient_service/examples/standard/v1/gemfile/services/read_file_content.rb', line 23 def result success(data: {content: ::File.read(path)}) end |