Class: CustomElementsManifestParser::Nodes::FunctionDeclaration
- Inherits:
-
BaseStruct
- Object
- Dry::Struct
- BaseStruct
- CustomElementsManifestParser::Nodes::FunctionDeclaration
- Includes:
- Mixins::HasParentModule, Structs::DeclarableNodeStruct, Structs::FunctionLikeStruct
- Defined in:
- lib/custom_elements_manifest_parser/nodes/function_declaration.rb
Overview
Documents a function
Instance Attribute Summary collapse
Class Method Summary collapse
Instance Method Summary collapse
Methods included from Mixins::HasParentModule
Instance Attribute Details
#kind ⇒ "function"
23 |
# File 'lib/custom_elements_manifest_parser/nodes/function_declaration.rb', line 23 attribute :kind, Types.Value("function") |
#source ⇒ SourceReference?
27 |
# File 'lib/custom_elements_manifest_parser/nodes/function_declaration.rb', line 27 attribute :source, Types::Strict::String.optional.(required: false) |
Class Method Details
.kind ⇒ "function"
19 |
# File 'lib/custom_elements_manifest_parser/nodes/function_declaration.rb', line 19 def self.kind; "function"; end |
Instance Method Details
#visit(parser:) ⇒ Object
29 30 31 32 33 34 35 36 37 38 |
# File 'lib/custom_elements_manifest_parser/nodes/function_declaration.rb', line 29 def visit(parser:) hash = {} 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::FunctionLikeStruct.build_hash(parser: parser, struct: self) ) new(hash) end |