Class: Lutaml::Xml::W3c::XlinkShowType

Inherits:
Model::Type::String show all
Defined in:
lib/lutaml/xml/w3c.rb

Overview

Type for xshow attribute

Indicates how the link target should be displayed. Valid values: “new”, “replace”, “embed”, “other”, “none”

Constant Summary collapse

VALID_SHOW =
%w[new replace embed other none].freeze

Constants inherited from Model::Type::Value

Model::Type::Value::EMPTY_OPTIONS

Instance Attribute Summary

Attributes inherited from Model::Type::Value

#value

Class Method Summary collapse

Methods inherited from Model::Type::String

default_xsd_type

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

included

Methods included from Model::Type::UninitializedClassGuard

#cast, #serialize

Constructor Details

This class inherits a constructor from Lutaml::Model::Type::Value

Class Method Details

.cast(value) ⇒ Object



330
331
332
333
334
335
336
337
338
339
340
341
# File 'lib/lutaml/xml/w3c.rb', line 330

def self.cast(value)
  return nil if value.nil?
  return value if Lutaml::Model::Utils.uninitialized?(value)

  val = super
  unless VALID_SHOW.include?(val)
    raise ArgumentError,
          "xlink:show must be one of: #{VALID_SHOW.join(', ')}"
  end

  val
end