Class: Lutaml::Yamls::Adapter::Mapping
- Inherits:
-
KeyValue::Mapping
- Object
- Model::Mapping
- KeyValue::Mapping
- Lutaml::Yamls::Adapter::Mapping
- Defined in:
- lib/lutaml/yamls/adapter/mapping.rb
Instance Attribute Summary collapse
-
#yamls_sequence ⇒ Object
Returns the value of attribute yamls_sequence.
Attributes inherited from KeyValue::Mapping
#format, #key_mapping, #register_mappings, #value_mapping
Attributes inherited from Model::Mapping
Instance Method Summary collapse
- #deep_dup ⇒ Object
- #dup_instance ⇒ Object
-
#initialize ⇒ Mapping
constructor
A new instance of Mapping.
- #sequence ⇒ Object
Methods inherited from KeyValue::Mapping
#finalize, #finalized?, #find_by_name, #find_by_to, #find_by_to!, #import_model_mappings, #instance_mapping?, #map, #map_all, #map_instances, #map_key, #map_to_instance, #map_value, #mappings, #mappings_hash, #name_for_mapping, #no_root, #no_root?, #polymorphic_mapping, #root, #root_mapping, #root_name, #validate!, #validate_blank_mappings!, #validate_mappings!, #validate_root_mappings!, #validate_to_and_with_arguments!, #validate_with_options!
Methods inherited from Model::Mapping
#add_listener, #all_listeners, #duplicate_mappings, #ensure_mappings_imported!, #inherit_from, #listeners_for, #omit_element, #omit_listener, #parent_mapping
Constructor Details
#initialize ⇒ Mapping
Returns a new instance of Mapping.
9 10 11 |
# File 'lib/lutaml/yamls/adapter/mapping.rb', line 9 def initialize super(:yaml) end |
Instance Attribute Details
#yamls_sequence ⇒ Object
Returns the value of attribute yamls_sequence.
7 8 9 |
# File 'lib/lutaml/yamls/adapter/mapping.rb', line 7 def yamls_sequence @yamls_sequence end |
Instance Method Details
#deep_dup ⇒ Object
22 23 24 25 26 |
# File 'lib/lutaml/yamls/adapter/mapping.rb', line 22 def deep_dup super.tap do |new_mapping| new_mapping.yamls_sequence = @yamls_sequence&.dup end end |
#dup_instance ⇒ Object
18 19 20 |
# File 'lib/lutaml/yamls/adapter/mapping.rb', line 18 def dup_instance self.class.new end |
#sequence ⇒ Object
13 14 15 16 |
# File 'lib/lutaml/yamls/adapter/mapping.rb', line 13 def sequence(&) @yamls_sequence = YamlsSequence.new @yamls_sequence.instance_eval(&) end |