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

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Config

included

Constructor Details

#initialize(content:) ⇒ StripComments

Returns a new instance of StripComments.



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

def initialize(content:)
  @content = content
end

Instance Attribute Details

#contentObject (readonly) Also known as: content_with_comments

Returns the value of attribute content.



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

def content
  @content
end

Instance Method Details

#resultObject



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

def result
  success(data: {content_without_comments: file_without_comments.read})
end