Class: CustomElementsManifestParser::Nodes::ClassDeclaration

Inherits:
BaseStruct
  • Object
show all
Includes:
Mixins::HasParentModule, Structs::CustomElementLikeStruct, Structs::DeclarableNodeStruct
Defined in:
lib/custom_elements_manifest_parser/nodes/class_declaration.rb

Overview

This is equivalent to CustomElementDeclaration.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Mixins::HasParentModule

#parent_module

Instance Attribute Details

#kind"class"

Returns:

  • ("class")


24
# File 'lib/custom_elements_manifest_parser/nodes/class_declaration.rb', line 24

attribute :kind, Types.Value("class")

Class Method Details

.kind"class"

Returns:

  • ("class")


12
# File 'lib/custom_elements_manifest_parser/nodes/class_declaration.rb', line 12

def self.kind; 'class'; end

Instance Method Details

#visit(parser:) ⇒ ClassDeclaration

Parameters:

  • parser (Parser)
    • Gets passed a parser

Returns:



28
29
30
31
32
33
34
35
36
37
# File 'lib/custom_elements_manifest_parser/nodes/class_declaration.rb', line 28

def visit(parser:)
  hash = {}

  hash = hash.merge(
    Structs::DeclarableNodeStruct.build_hash(parser: parser, struct: self),
    Structs::CustomElementLikeStruct.build_hash(parser: parser, struct: self)
  )

  new(hash)
end