Class: CustomElementsManifestParser::Nodes::ClassField
- Inherits:
-
BaseStruct
- Object
- Dry::Struct
- BaseStruct
- CustomElementsManifestParser::Nodes::ClassField
- Includes:
- Mixins::HasParentModule, Structs::DeclarableNodeStruct, Structs::PropertyLikeStruct
- Defined in:
- lib/custom_elements_manifest_parser/nodes/class_field.rb
Overview
Documents a class property. This does not get used directly. Instead, it gets extended by CustomElementField.
Direct Known Subclasses
Instance Attribute Summary collapse
Class Method Summary collapse
Instance Method Summary collapse
Methods included from Mixins::HasParentModule
Instance Attribute Details
#inheritedFrom ⇒ Reference?
24 |
# File 'lib/custom_elements_manifest_parser/nodes/class_field.rb', line 24 attribute :inheritedFrom, Types::Nominal::Any.optional.(required: false) |
#kind ⇒ 'field'
16 |
# File 'lib/custom_elements_manifest_parser/nodes/class_field.rb', line 16 attribute :kind, Types.Value("field") |
#privacy ⇒ Boolean?
20 |
# File 'lib/custom_elements_manifest_parser/nodes/class_field.rb', line 20 attribute :static, Types::Strict::Bool.optional.(required: false) |
#source ⇒ SourceReference?
28 |
# File 'lib/custom_elements_manifest_parser/nodes/class_field.rb', line 28 attribute :source, Types::Nominal::Any.optional.(required: false) |
Class Method Details
.kind ⇒ "field"
12 |
# File 'lib/custom_elements_manifest_parser/nodes/class_field.rb', line 12 def self.kind; "field"; end |
Instance Method Details
#visit(parser:) ⇒ Object
38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/custom_elements_manifest_parser/nodes/class_field.rb', line 38 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::DeclarableNodeStruct.build_hash(parser: parser, struct: self), Structs::PropertyLikeStruct.build_hash(parser: parser, struct: self) ) new(hash) end |