Skip to Content Skip to Search

class Rails::SourceAnnotationExtractor::ParserExtractor::Parser

Inherits From

Attributes

[R] comments
[R] pattern

Public class methods

Source code GitHub
# File railties/lib/rails/source_annotation_extractor.rb, line 22
def initialize(source, pattern:)
  super(source)
  @pattern = pattern
  @comments = []
end

Public instance methods

Source code GitHub
# File railties/lib/rails/source_annotation_extractor.rb, line 28
def on_comment(value)
  @comments << Annotation.new(lineno, $1, $2) if value =~ pattern
end

Definition files