Class: CustomElementsManifestParser::DataTypes::Type
- Inherits:
-
BaseStruct
- Object
- Dry::Struct
- BaseStruct
- CustomElementsManifestParser::DataTypes::Type
- Defined in:
- lib/custom_elements_manifest_parser/data_types/type.rb
Overview
Documents a JSDoc, Closure, or TypeScript type.
Instance Attribute Summary collapse
-
#references ⇒ nil, ...
Nil, Array
- An array of references to the types in the type string. - #source ⇒ nil, SourceReference
Instance Method Summary collapse
Instance Attribute Details
#references ⇒ nil, ...
Returns nil, ArrayArray<FooElement | BarElement>
with cross-references to FooElement
and BarElement
without understanding arrays, generics, or union types.
21 |
# File 'lib/custom_elements_manifest_parser/data_types/type.rb', line 21 attribute :references, Types::Strict::Array.optional.(required: false) |
#source ⇒ nil, SourceReference
25 |
# File 'lib/custom_elements_manifest_parser/data_types/type.rb', line 25 attribute :source, Types::Nominal::Any.optional.(required: false) |
Instance Method Details
#visit(parser:) ⇒ Object
27 28 29 30 31 |
# File 'lib/custom_elements_manifest_parser/data_types/type.rb', line 27 def visit(parser:) hash = {} hash[:references] = references.map { |reference| parser.data_types[:type_reference].new(reference).visit(parser: parser) } unless references.nil? new(hash) end |