Class: CustomElementsManifestParser::Nodes::Manifest

Inherits:
BaseStruct
  • Object
show all
Defined in:
lib/custom_elements_manifest_parser/nodes/manifest.rb

Overview

top level of a custom elements manifest. This technically isn't a "ParseableNode". its a top level "root" of a custom-elements.json.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#deprecatedString, ...

Returns - if nil or false, not deprecated. If true, deprecated. If string, why it's deprecated.

Returns:

  • (String, Boolean, nil)
    • if nil or false, not deprecated. If true, deprecated. If string, why it's deprecated.


22
# File 'lib/custom_elements_manifest_parser/nodes/manifest.rb', line 22

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

#modulesArray<Nodes::JavaScriptModule>

Returns - An array of the modules this package contains..

Returns:



14
# File 'lib/custom_elements_manifest_parser/nodes/manifest.rb', line 14

attribute :modules, Types::Strict::Array

#readmeString?

Returns - The Markdown to use for the main readme of this package.

Returns:

  • (String, nil)
    • The Markdown to use for the main readme of this package.


18
# File 'lib/custom_elements_manifest_parser/nodes/manifest.rb', line 18

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

#schemaVersionString

Returns - Version of the schema.

Returns:

  • (String)
    • Version of the schema.


10
# File 'lib/custom_elements_manifest_parser/nodes/manifest.rb', line 10

attribute :schemaVersion, Types::Strict::String

Instance Method Details

#visit(parser:) ⇒ Object



24
25
26
27
28
29
30
31
32
33
# File 'lib/custom_elements_manifest_parser/nodes/manifest.rb', line 24

def visit(parser:)
  hash = {}

  hash[:modules] = modules.map do |mod|
    parser.visit_node(mod)
  end

  hash[:modules]
  new(hash)
end