Class: Lutaml::Xml::W3c::XlinkTypeAttrType
- Inherits:
-
Model::Type::String
- Object
- Model::Type::Value
- Model::Type::String
- Lutaml::Xml::W3c::XlinkTypeAttrType
- Defined in:
- lib/lutaml/xml/w3c.rb
Overview
Type for xtype attribute
Identifies the link type. Valid values: “simple”, “extended”, “locator”, “arc”, “resource”, “title”
Constant Summary collapse
- VALID_TYPES =
%w[simple extended locator arc resource title].freeze
Constants inherited from Model::Type::Value
Model::Type::Value::EMPTY_OPTIONS
Instance Attribute Summary
Attributes inherited from Model::Type::Value
Class Method Summary collapse
Methods inherited from Model::Type::String
Methods inherited from Model::Type::Value
format_type_serializer_for, from_format, #initialize, #initialized?, register_format_to_from_methods, register_format_type_serializer, serialize, #to_s
Methods included from Type::Configurable
Methods included from Model::Type::UninitializedClassGuard
Constructor Details
This class inherits a constructor from Lutaml::Model::Type::Value
Class Method Details
.cast(value) ⇒ Object
270 271 272 273 274 275 276 277 278 279 280 281 |
# File 'lib/lutaml/xml/w3c.rb', line 270 def self.cast(value) return nil if value.nil? return value if Lutaml::Model::Utils.uninitialized?(value) val = super unless VALID_TYPES.include?(val) raise ArgumentError, "xlink:type must be one of: #{VALID_TYPES.join(', ')}" end val end |