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