Class: CustomElementsManifestParser::DataTypes::Event

Inherits:
BaseStruct
  • Object
show all
Defined in:
lib/custom_elements_manifest_parser/data_types/event.rb

Overview

Documents events on a custom element

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#deprecatednil, ...

Returns Whether the event is deprecated. If the value is a string, it's the reason for the deprecation.

Returns:

  • (nil, Boolean, String)

    Whether the event is deprecated. If the value is a string, it's the reason for the deprecation.



31
# File 'lib/custom_elements_manifest_parser/data_types/event.rb', line 31

attribute :deprecated, Types::Strict::String.optional | Types::Strict::Bool.optional.meta(required: false)

#descriptionnil, String

Returns - A markdown description.

Returns:

  • (nil, String)
    • A markdown description.


21
# File 'lib/custom_elements_manifest_parser/data_types/event.rb', line 21

attribute :description, Types::Strict::String.optional.meta(required: false)

#inheritedFromnil, Reference

Returns:



25
# File 'lib/custom_elements_manifest_parser/data_types/event.rb', line 25

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

#nameString

Returns - Name of the event.

Returns:

  • (String)
    • Name of the event


10
# File 'lib/custom_elements_manifest_parser/data_types/event.rb', line 10

attribute :name, Types::Strict::String

#typeType

Returns - The type of the event object that's fired.

Returns:

  • (Type)
    • The type of the event object that's fired.


14
# File 'lib/custom_elements_manifest_parser/data_types/event.rb', line 14

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

Instance Method Details

#visit(parser:) ⇒ Object



33
34
35
36
37
# File 'lib/custom_elements_manifest_parser/data_types/event.rb', line 33

def visit(parser:)
  hash = {}
  hash[:type] = parser.data_types[:type].new(type).visit(parser: parser) if type
  new(hash)
end