Class: RailsOpenapiGen::Parsers::CommentParser

Inherits:
Object
  • Object
show all
Defined in:
lib/rails-openapi-gen/parsers/comment_parser.rb

Instance Method Summary collapse

Constructor Details

#initializeCommentParser

Returns a new instance of CommentParser.



13
14
15
16
17
18
19
20
21
22
# File 'lib/rails-openapi-gen/parsers/comment_parser.rb', line 13

def initialize
  @parsers = [
    ConditionalParser.new,
    OperationParser.new,
    ParamParser.new,
    QueryParser.new,
    BodyParser.new,
    AttributeParser.new
  ]
end

Instance Method Details

#parse(comment_text) ⇒ Object



24
25
26
27
28
29
# File 'lib/rails-openapi-gen/parsers/comment_parser.rb', line 24

def parse(comment_text)
  parser = find_parser(comment_text)
  return nil unless parser

  parser.parse(comment_text)
end