Class: Synthra::Parser::AST::ProgramNode
- Defined in:
- lib/synthra/parser/ast.rb
Overview
Program node - root of the AST
Contains all top-level definitions: schemas and APIs. This is the entry point for the parsed DSL.
Instance Attribute Summary collapse
-
#apis ⇒ Object
readonly
Returns the value of attribute apis.
-
#legacy_schemas ⇒ Object
readonly
Returns the value of attribute legacy_schemas.
-
#schemas ⇒ Object
readonly
Returns the value of attribute schemas.
Instance Method Summary collapse
-
#all_schemas ⇒ Array<SchemaDefinitionNode, SchemaNode>
Get all schema nodes (both new and legacy).
-
#initialize(schemas: [], apis: [], legacy_schemas: [], line: nil) ⇒ ProgramNode
constructor
Create a new ProgramNode.
Constructor Details
#initialize(schemas: [], apis: [], legacy_schemas: [], line: nil) ⇒ ProgramNode
Create a new ProgramNode
748 749 750 751 752 753 |
# File 'lib/synthra/parser/ast.rb', line 748 def initialize(schemas: [], apis: [], legacy_schemas: [], line: nil) super(line: line) @schemas = schemas @apis = apis @legacy_schemas = legacy_schemas end |
Instance Attribute Details
#apis ⇒ Object (readonly)
Returns the value of attribute apis.
732 733 734 |
# File 'lib/synthra/parser/ast.rb', line 732 def apis @apis end |
#legacy_schemas ⇒ Object (readonly)
Returns the value of attribute legacy_schemas.
738 739 740 |
# File 'lib/synthra/parser/ast.rb', line 738 def legacy_schemas @legacy_schemas end |
#schemas ⇒ Object (readonly)
Returns the value of attribute schemas.
726 727 728 |
# File 'lib/synthra/parser/ast.rb', line 726 def schemas @schemas end |
Instance Method Details
#all_schemas ⇒ Array<SchemaDefinitionNode, SchemaNode>
Get all schema nodes (both new and legacy)
760 761 762 |
# File 'lib/synthra/parser/ast.rb', line 760 def all_schemas schemas + legacy_schemas end |