Class: CustomElementsManifestParser::Nodes::VariableDeclaration
- Inherits:
-
BaseStruct
- Object
- Dry::Struct
- BaseStruct
- CustomElementsManifestParser::Nodes::VariableDeclaration
- Includes:
- Mixins::HasParentModule, Structs::DeclarableNodeStruct, Structs::PropertyLikeStruct
- Defined in:
- lib/custom_elements_manifest_parser/nodes/variable_declaration.rb
Overview
Documents a variable
Instance Attribute Summary collapse
Class Method Summary collapse
Instance Method Summary collapse
Methods included from Mixins::HasParentModule
Instance Attribute Details
#kind ⇒ "variable"
24 |
# File 'lib/custom_elements_manifest_parser/nodes/variable_declaration.rb', line 24 attribute :kind, Types.Value("variable") |
#source ⇒ Nodes::SourceReference?
28 |
# File 'lib/custom_elements_manifest_parser/nodes/variable_declaration.rb', line 28 attribute :source, Types::Nominal::Any.optional.(required: false) |
Class Method Details
.kind ⇒ "variable"
20 |
# File 'lib/custom_elements_manifest_parser/nodes/variable_declaration.rb', line 20 def self.kind; "variable"; end |
Instance Method Details
#visit(parser:) ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/custom_elements_manifest_parser/nodes/variable_declaration.rb', line 30 def visit(parser:) hash = {} hash[:source] = parser.data_types[:source].new(source).visit(parser: parser) unless source.nil? hash = hash.merge( Structs::DeclarableNodeStruct.build_hash(parser: parser, struct: self), Structs::PropertyLikeStruct.build_hash(parser: parser, struct: self), ) new(hash) end |