Class: Synthra::Parser::AST::SchemaReferenceNode
- Defined in:
- lib/synthra/parser/ast.rb
Overview
Schema reference node
Represents an explicit schema reference using the syntax:
schema(:Name) or schema(:Name).array
This is the ONLY valid way to reference schemas in the new DSL. The system must NEVER infer schemas from capitalization.
Instance Attribute Summary collapse
-
#array ⇒ Object
readonly
Returns the value of attribute array.
-
#array_range ⇒ Object
readonly
Returns the value of attribute array_range.
-
#optional ⇒ Object
readonly
Returns the value of attribute optional.
-
#schema_name ⇒ Object
readonly
Returns the value of attribute schema_name.
Instance Method Summary collapse
-
#array? ⇒ Boolean
Check if this is an array reference.
-
#initialize(schema_name:, array: false, array_range: nil, optional: false, line: nil) ⇒ SchemaReferenceNode
constructor
Create a new SchemaReferenceNode.
-
#optional? ⇒ Boolean
Check if this is an optional reference.
Constructor Details
#initialize(schema_name:, array: false, array_range: nil, optional: false, line: nil) ⇒ SchemaReferenceNode
Create a new SchemaReferenceNode
1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 |
# File 'lib/synthra/parser/ast.rb', line 1077 def initialize(schema_name:, array: false, array_range: nil, optional: false, line: nil) super( name: "schema_ref", arguments: { schema_name: schema_name, array: array, array_range: array_range }, nullable: optional, line: line ) @schema_name = schema_name @array = array @array_range = array_range @optional = optional end |
Instance Attribute Details
#array ⇒ Object (readonly)
Returns the value of attribute array.
1054 1055 1056 |
# File 'lib/synthra/parser/ast.rb', line 1054 def array @array end |
#array_range ⇒ Object (readonly)
Returns the value of attribute array_range.
1060 1061 1062 |
# File 'lib/synthra/parser/ast.rb', line 1060 def array_range @array_range end |
#optional ⇒ Object (readonly)
Returns the value of attribute optional.
1066 1067 1068 |
# File 'lib/synthra/parser/ast.rb', line 1066 def optional @optional end |
#schema_name ⇒ Object (readonly)
Returns the value of attribute schema_name.
1048 1049 1050 |
# File 'lib/synthra/parser/ast.rb', line 1048 def schema_name @schema_name end |
Instance Method Details
#array? ⇒ Boolean
Check if this is an array reference
1099 1100 1101 |
# File 'lib/synthra/parser/ast.rb', line 1099 def array? @array end |
#optional? ⇒ Boolean
Check if this is an optional reference
1108 1109 1110 |
# File 'lib/synthra/parser/ast.rb', line 1108 def optional? @optional end |