Class: CustomElementsManifestParser::Structs::PropertyLikeStruct
- Inherits:
-
BaseStruct
- Object
- Dry::Struct
- BaseStruct
- CustomElementsManifestParser::Structs::PropertyLikeStruct
- Defined in:
- lib/custom_elements_manifest_parser/structs/property_like_struct.rb
Overview
The common interface of variables, class fields, and function parameters.
Instance Attribute Summary collapse
-
#default ⇒ String?
- Default value.
-
#deprecated ⇒ nil, ...
- Whether the property is deprecated.
-
#description ⇒ String?
- A markdown description of the field.
-
#name ⇒ String
- Name of the property.
-
#readonly ⇒ nil, Boolean
- Whether the property is read-only.
-
#summary ⇒ String?
- A markdown summary suitable for display in a listing.
-
#type ⇒ nil, Type
- The type serializer IE: "Object", "String", etc.
Class Method Summary collapse
Instance Attribute Details
#default ⇒ String?
Returns - Default value.
27 |
# File 'lib/custom_elements_manifest_parser/structs/property_like_struct.rb', line 27 attribute :default, Types::Strict::String.optional.(required: false) |
#deprecated ⇒ nil, ...
Returns - Whether the property is deprecated. If the value is a string, it's the reason for the deprecation.
33 |
# File 'lib/custom_elements_manifest_parser/structs/property_like_struct.rb', line 33 attribute :deprecated, Types::Strict::Bool.optional | Types::Strict::String.optional.(required: false) |
#description ⇒ String?
Returns - A markdown description of the field.
19 |
# File 'lib/custom_elements_manifest_parser/structs/property_like_struct.rb', line 19 attribute :description, Types::Strict::String.optional.(required: false) |
#name ⇒ String
Returns - Name of the property.
11 |
# File 'lib/custom_elements_manifest_parser/structs/property_like_struct.rb', line 11 attribute :name, Types::Strict::String |
#readonly ⇒ nil, Boolean
Returns - Whether the property is read-only.
37 |
# File 'lib/custom_elements_manifest_parser/structs/property_like_struct.rb', line 37 attribute :readonly, Types::Strict::Bool.optional.(required: false) |
#summary ⇒ String?
Returns - A markdown summary suitable for display in a listing.
15 |
# File 'lib/custom_elements_manifest_parser/structs/property_like_struct.rb', line 15 attribute :summary, Types::Strict::String.optional.(required: false) |
#type ⇒ nil, Type
Returns - The type serializer IE: "Object", "String", etc.
23 |
# File 'lib/custom_elements_manifest_parser/structs/property_like_struct.rb', line 23 attribute :type, Types::Nominal::Any.optional.(required: false) |
Class Method Details
.build_hash(parser:, struct:) ⇒ Object
39 40 41 42 43 |
# File 'lib/custom_elements_manifest_parser/structs/property_like_struct.rb', line 39 def self.build_hash(parser:, struct:) hash = {} hash[:type] = parser.data_types[:type].new(struct.type).visit(parser: parser) if struct.type hash end |