Method: CommentExtractor::Parser.initialize_with_extractor

Defined in:
lib/comment_extractor/parser.rb

.initialize_with_extractor(file_path, extractor) ⇒ Object



24
25
26
27
28
29
30
31
# File 'lib/comment_extractor/parser.rb', line 24

def self.initialize_with_extractor(file_path, extractor)
  content = File.open(file_path, 'r') { |f| f.read_content }

  # Initialize parser
  code_objects = CodeObjects.new(file: file_path)
  instance_of_extractor = extractor.new(content, code_objects)
  new(instance_of_extractor)
end