Class: CustomElementsManifestParser::Nodes::ClassMethod
- Inherits:
-
BaseStruct
- Object
- Dry::Struct
- BaseStruct
- CustomElementsManifestParser::Nodes::ClassMethod
- 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
- #inheritedFrom ⇒ Reference?
- #kind ⇒ "method"
- #privacy ⇒ Types.privacy?
- #source ⇒ SourceReference?
- #static ⇒ Boolean?
Class Method Summary collapse
Instance Method Summary collapse
Methods included from Mixins::HasParentModule
Instance Attribute Details
#inheritedFrom ⇒ Reference?
36 |
# File 'lib/custom_elements_manifest_parser/nodes/class_method.rb', line 36 attribute :inheritedFrom, Types::Nominal::Any.optional.(required: false) |
#kind ⇒ "method"
24 |
# File 'lib/custom_elements_manifest_parser/nodes/class_method.rb', line 24 attribute :kind, Types.Value("method") |
#privacy ⇒ Types.privacy?
32 |
# File 'lib/custom_elements_manifest_parser/nodes/class_method.rb', line 32 attribute :privacy, Types.privacy.optional.(required: false) |
#source ⇒ SourceReference?
40 |
# File 'lib/custom_elements_manifest_parser/nodes/class_method.rb', line 40 attribute :source, Types::Nominal::Any.optional.(required: false) |
#static ⇒ Boolean?
28 |
# File 'lib/custom_elements_manifest_parser/nodes/class_method.rb', line 28 attribute :static, Types::Strict::Bool.optional.(required: false) |
Class Method Details
.kind ⇒ "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 |