Class: CustomElementsManifestParser::Structs::FunctionLikeStruct
- Inherits:
-
BaseStruct
- Object
- Dry::Struct
- BaseStruct
- CustomElementsManifestParser::Structs::FunctionLikeStruct
- Defined in:
- lib/custom_elements_manifest_parser/structs/function_like_struct.rb
Overview
An interface for functions / methods.
Instance Attribute Summary collapse
-
#deprecated ⇒ Boolean, ...
Whether the function is deprecated.
-
#description ⇒ String?
- A markdown description.
-
#name ⇒ String?
- Name of the function.
-
#summary ⇒ String?
- A markdown summary suitable for display in a listing.
Class Method Summary collapse
Instance Attribute Details
#deprecated ⇒ Boolean, ...
Returns Whether the function is deprecated. If the value is a string, it's the reason for the deprecation.
24 |
# File 'lib/custom_elements_manifest_parser/structs/function_like_struct.rb', line 24 attribute :deprecated, Types::Strict::String.optional | Types::Strict::Bool.optional.(required: false) |
#description ⇒ String?
Returns - A markdown description.
18 |
# File 'lib/custom_elements_manifest_parser/structs/function_like_struct.rb', line 18 attribute :description, Types::Strict::String.optional.(required: false) |
#name ⇒ String?
Returns - Name of the function.
10 |
# File 'lib/custom_elements_manifest_parser/structs/function_like_struct.rb', line 10 attribute :name, Types::Strict::String.optional.(required: false) |
#summary ⇒ String?
Returns - A markdown summary suitable for display in a listing.
14 |
# File 'lib/custom_elements_manifest_parser/structs/function_like_struct.rb', line 14 attribute :summary, Types::Strict::String.optional.(required: false) |
Class Method Details
.build_hash(parser:, struct:) ⇒ Object
32 33 34 35 36 37 |
# File 'lib/custom_elements_manifest_parser/structs/function_like_struct.rb', line 32 def self.build_hash(parser:, struct:) hash = {} hash[:parameters] = struct.parameters.map { |parameter| parser.data_types[:parameter].new(parameter).visit(parser: parser) } if struct.parameters hash[:return] = parser.data_types[:function_return_type].new(struct.return).visit(parser: parser) if struct.return hash end |