Class: CustomElementsManifestParser::Nodes::CustomElementExport
- Inherits:
-
BaseStruct
- Object
- Dry::Struct
- BaseStruct
- CustomElementsManifestParser::Nodes::CustomElementExport
- Includes:
- Mixins::HasParentModule
- Defined in:
- lib/custom_elements_manifest_parser/nodes/custom_element_export.rb
Overview
A global custom element defintion, ie the result of a
customElements.define()
call.
This is represented as an export because a definition makes the element available outside of the module it's defined it.
Instance Attribute Summary collapse
-
#declaration ⇒ Reference
A reference to the class or other declaration that implements the custom element.
- #kind ⇒ "custom-element-definition"
-
#name ⇒ String
- The tag name of the custom element.
Class Method Summary collapse
Instance Method Summary collapse
Methods included from Mixins::HasParentModule
Instance Attribute Details
#declaration ⇒ Reference
Returns A reference to the class or other declaration that implements the custom element.
36 |
# File 'lib/custom_elements_manifest_parser/nodes/custom_element_export.rb', line 36 attribute :declaration, Types::Nominal::Any |
#kind ⇒ "custom-element-definition"
21 |
# File 'lib/custom_elements_manifest_parser/nodes/custom_element_export.rb', line 21 attribute :kind, Types.Value("custom-element-definition") |
#name ⇒ String
Returns - The tag name of the custom element.
30 |
# File 'lib/custom_elements_manifest_parser/nodes/custom_element_export.rb', line 30 attribute :name, Types::Strict::String |
Class Method Details
.kind ⇒ "custom-element-definition"
17 |
# File 'lib/custom_elements_manifest_parser/nodes/custom_element_export.rb', line 17 def self.kind; "custom-element-definition"; end |
Instance Method Details
#visit(parser:) ⇒ Object
44 45 46 47 48 49 50 51 |
# File 'lib/custom_elements_manifest_parser/nodes/custom_element_export.rb', line 44 def visit(parser:) hash = {} hash[:declaration] = parser.data_types[:declaration].new(declaration).visit(parser: parser) hash = hash.merge( Structs::DeclarableNodeStruct.build_hash(parser: parser, struct: self) ) new(hash) end |