Class: CustomElementsManifestParser::Nodes::ClassMethod

Inherits:
BaseStruct
  • Object
show all
Includes:
Mixins::HasParentModule
Defined in:
lib/custom_elements_manifest_parser/nodes/class_method.rb

Overview

Documents a method attached to a class

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Mixins::HasParentModule

#parent_module

Instance Attribute Details

#inheritedFromReference?

Returns:

  • (Reference, nil)


36
# File 'lib/custom_elements_manifest_parser/nodes/class_method.rb', line 36

attribute :inheritedFrom, Types::Nominal::Any.optional.meta(required: false)

#kind"method"

Returns:

  • ("method")


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

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

#privacyTypes.privacy?

Returns:



32
# File 'lib/custom_elements_manifest_parser/nodes/class_method.rb', line 32

attribute :privacy, Types.privacy.optional.meta(required: false)

#sourceSourceReference?

Returns:

  • (SourceReference, nil)


40
# File 'lib/custom_elements_manifest_parser/nodes/class_method.rb', line 40

attribute :source, Types::Nominal::Any.optional.meta(required: false)

#staticBoolean?

Returns:

  • (Boolean, nil)


28
# File 'lib/custom_elements_manifest_parser/nodes/class_method.rb', line 28

attribute :static, Types::Strict::Bool.optional.meta(required: false)

Class Method Details

.kind"method"

Returns:

  • ("method")


20
# File 'lib/custom_elements_manifest_parser/nodes/class_method.rb', line 20

def self.kind; 'method'; end

Instance Method Details

#visit(parser:) ⇒ Object



42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/custom_elements_manifest_parser/nodes/class_method.rb', line 42

def visit(parser:)
  hash = {}
  hash[:inheritedFrom] = parser.data_types[:inherited_from].new(inheritedFrom).visit(parser: parser) unless inheritedFrom.nil?
  hash[:source] = parser.data_types[:source].new(source).visit(parser: parser) unless source.nil?

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

  new(hash)
end