Class: RailsOpenapiGen::Parsers::Jbuilder::JbuilderParser
- Inherits:
-
Object
- Object
- RailsOpenapiGen::Parsers::Jbuilder::JbuilderParser
- Defined in:
- lib/rails-openapi-gen/parsers/jbuilder/jbuilder_parser.rb
Instance Attribute Summary collapse
-
#ast_parser ⇒ Object
readonly
Returns the value of attribute ast_parser.
-
#jbuilder_path ⇒ Object
readonly
Returns the value of attribute jbuilder_path.
Instance Method Summary collapse
-
#initialize(jbuilder_path) ⇒ JbuilderParser
constructor
Initializes Jbuilder parser with template path.
-
#parse ⇒ RailsOpenapiGen::AstNodes::BaseNode
(also: #parse_ast)
Main parsing method using AST-based architecture.
Constructor Details
#initialize(jbuilder_path) ⇒ JbuilderParser
Initializes Jbuilder parser with template path
16 17 18 19 20 21 22 23 24 |
# File 'lib/rails-openapi-gen/parsers/jbuilder/jbuilder_parser.rb', line 16 def initialize(jbuilder_path) @jbuilder_path = jbuilder_path @properties = [] @operation_info = nil @parsed_files = Set.new @operation_parser = nil @property_parser = nil @ast_parser = nil end |
Instance Attribute Details
#ast_parser ⇒ Object (readonly)
Returns the value of attribute ast_parser.
12 13 14 |
# File 'lib/rails-openapi-gen/parsers/jbuilder/jbuilder_parser.rb', line 12 def ast_parser @ast_parser end |
#jbuilder_path ⇒ Object (readonly)
Returns the value of attribute jbuilder_path.
12 13 14 |
# File 'lib/rails-openapi-gen/parsers/jbuilder/jbuilder_parser.rb', line 12 def jbuilder_path @jbuilder_path end |
Instance Method Details
#parse ⇒ RailsOpenapiGen::AstNodes::BaseNode Also known as: parse_ast
Main parsing method using AST-based architecture
28 29 30 31 32 33 34 |
# File 'lib/rails-openapi-gen/parsers/jbuilder/jbuilder_parser.rb', line 28 def parse @ast_parser = AstParser.new(jbuilder_path) return nil unless File.exist?(jbuilder_path) @ast_parser.parse end |