Class: Lutaml::Model::Schema::Definitions::UnionType
- Inherits:
-
Object
- Object
- Lutaml::Model::Schema::Definitions::UnionType
- Defined in:
- lib/lutaml/model/schema/definitions/union_type.rb
Overview
Union type — Lutaml::Model::Type::Value subclass whose cast tries each member type and returns the first that parses. cast_strategy ∈ :class_refs.
Instance Attribute Summary collapse
-
#cast_strategy ⇒ Object
Returns the value of attribute cast_strategy.
-
#class_name ⇒ Object
Returns the value of attribute class_name.
-
#keep_register_when_namespaced ⇒ Object
Returns the value of attribute keep_register_when_namespaced.
-
#lazy_register ⇒ Object
Returns the value of attribute lazy_register.
-
#members ⇒ Object
Returns the value of attribute members.
-
#required_files ⇒ Object
Returns the value of attribute required_files.
Instance Method Summary collapse
-
#initialize(class_name:, members:, cast_strategy:, required_files: [], lazy_register: false, keep_register_when_namespaced: false) ⇒ UnionType
constructor
A new instance of UnionType.
Constructor Details
#initialize(class_name:, members:, cast_strategy:, required_files: [], lazy_register: false, keep_register_when_namespaced: false) ⇒ UnionType
Returns a new instance of UnionType.
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/lutaml/model/schema/definitions/union_type.rb', line 14 def initialize(class_name:, members:, cast_strategy:, required_files: [], lazy_register: false, keep_register_when_namespaced: false) @class_name = class_name @members = members @cast_strategy = cast_strategy @required_files = required_files @lazy_register = lazy_register @keep_register_when_namespaced = keep_register_when_namespaced end |
Instance Attribute Details
#cast_strategy ⇒ Object
Returns the value of attribute cast_strategy.
11 12 13 |
# File 'lib/lutaml/model/schema/definitions/union_type.rb', line 11 def cast_strategy @cast_strategy end |
#class_name ⇒ Object
Returns the value of attribute class_name.
11 12 13 |
# File 'lib/lutaml/model/schema/definitions/union_type.rb', line 11 def class_name @class_name end |
#keep_register_when_namespaced ⇒ Object
Returns the value of attribute keep_register_when_namespaced.
11 12 13 |
# File 'lib/lutaml/model/schema/definitions/union_type.rb', line 11 def keep_register_when_namespaced @keep_register_when_namespaced end |
#lazy_register ⇒ Object
Returns the value of attribute lazy_register.
11 12 13 |
# File 'lib/lutaml/model/schema/definitions/union_type.rb', line 11 def lazy_register @lazy_register end |
#members ⇒ Object
Returns the value of attribute members.
11 12 13 |
# File 'lib/lutaml/model/schema/definitions/union_type.rb', line 11 def members @members end |
#required_files ⇒ Object
Returns the value of attribute required_files.
11 12 13 |
# File 'lib/lutaml/model/schema/definitions/union_type.rb', line 11 def required_files @required_files end |