Class: CustomElementsManifestParser::DataTypes::Parameter
- Inherits:
-
BaseStruct
- Object
- Dry::Struct
- BaseStruct
- CustomElementsManifestParser::DataTypes::Parameter
- Includes:
- Structs::PropertyLikeStruct
- Defined in:
- lib/custom_elements_manifest_parser/data_types/parameter.rb
Overview
Documents a parameter on a function
Instance Attribute Summary collapse
-
#optional ⇒ Boolean?
- Whether the parameter is optional.
-
#rest ⇒ Boolean?
- Whether the parameter is a rest parameter.
Instance Method Summary collapse
Instance Attribute Details
#optional ⇒ Boolean?
Returns - Whether the parameter is optional. Undefined implies non-optional.
15 |
# File 'lib/custom_elements_manifest_parser/data_types/parameter.rb', line 15 attribute :optional, Types::Strict::Bool.optional.(required: false) |
#rest ⇒ Boolean?
Returns - Whether the parameter is a rest parameter. Only the last parameter may be a rest parameter. Undefined implies single parameter.
21 |
# File 'lib/custom_elements_manifest_parser/data_types/parameter.rb', line 21 attribute :rest, Types::Strict::Bool.optional.(required: false) |
Instance Method Details
#visit(parser:) ⇒ Object
23 24 25 26 27 28 29 30 |
# File 'lib/custom_elements_manifest_parser/data_types/parameter.rb', line 23 def visit(parser:) hash = {} hash = hash.merge( Structs::PropertyLikeStruct.build_hash(parser: parser, struct: self) ) new(hash) end |