Class: ConvenientService::Examples::Standard::Gemfile::Services::StripComments

Inherits:
Object
  • Object
show all
Includes:
Service::Configs::Standard
Defined in:
lib/convenient_service/examples/standard/gemfile/services/strip_comments.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(content:) ⇒ StripComments

Returns a new instance of StripComments.



29
30
31
# File 'lib/convenient_service/examples/standard/gemfile/services/strip_comments.rb', line 29

def initialize(content:)
  @content = content
end

Instance Attribute Details

#contentObject (readonly) Also known as: content_with_comments

Returns the value of attribute content.



21
22
23
# File 'lib/convenient_service/examples/standard/gemfile/services/strip_comments.rb', line 21

def content
  @content
end

Instance Method Details

#resultObject



33
34
35
# File 'lib/convenient_service/examples/standard/gemfile/services/strip_comments.rb', line 33

def result
  success(content_without_comments: file_without_comments.read)
end