Class: CustomElementsManifestParser::DataTypes::Demo
- Inherits:
-
BaseStruct
- Object
- Dry::Struct
- BaseStruct
- CustomElementsManifestParser::DataTypes::Demo
- Defined in:
- lib/custom_elements_manifest_parser/data_types/demo.rb
Overview
Links to a demo of the element
Instance Attribute Summary collapse
-
#description ⇒ String?
- A markdown description of the demo.
- #source ⇒ SourceReference?
-
#url ⇒ String
- Relative URL of the demo if it's published with the package.
Instance Method Summary collapse
Instance Attribute Details
#description ⇒ String?
Returns - A markdown description of the demo.
16 |
# File 'lib/custom_elements_manifest_parser/data_types/demo.rb', line 16 attribute :description, Types::Strict::String.optional.(required: false) |
#source ⇒ SourceReference?
20 |
# File 'lib/custom_elements_manifest_parser/data_types/demo.rb', line 20 attribute :source, Types::Nominal::Any.optional.(required: false) |
#url ⇒ String
Returns - Relative URL of the demo if it's published with the package. Absolute URL if it's hosted.
12 |
# File 'lib/custom_elements_manifest_parser/data_types/demo.rb', line 12 attribute :url, Types::Strict::String |
Instance Method Details
#visit(parser:) ⇒ Object
22 23 24 25 26 |
# File 'lib/custom_elements_manifest_parser/data_types/demo.rb', line 22 def visit(parser:) hash = {} hash[:source] = parser.data_types[:source].new(source).visit(parser: parser) if source new(hash) end |