Class: Lutaml::Model::KeyValueMappingRule
- Inherits:
-
MappingRule
- Object
- MappingRule
- Lutaml::Model::KeyValueMappingRule
- Defined in:
- lib/lutaml/model/key_value_mapping_rule.rb
Instance Attribute Summary collapse
-
#child_mappings ⇒ Object
readonly
Returns the value of attribute child_mappings.
Attributes inherited from MappingRule
#attribute, #custom_methods, #delegate, #name, #render_default, #render_nil, #to
Instance Method Summary collapse
- #deep_dup ⇒ Object
-
#initialize(name, to:, render_nil: false, render_default: false, with: {}, delegate: nil, child_mappings: nil, id: nil) ⇒ KeyValueMappingRule
constructor
A new instance of KeyValueMappingRule.
Methods inherited from MappingRule
#deserialize, #multiple_mappings?, #serialize, #serialize_attribute, #to_value_for, #using_custom_methods?
Constructor Details
#initialize(name, to:, render_nil: false, render_default: false, with: {}, delegate: nil, child_mappings: nil, id: nil) ⇒ KeyValueMappingRule
Returns a new instance of KeyValueMappingRule.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/lutaml/model/key_value_mapping_rule.rb', line 8 def initialize( name, to:, render_nil: false, render_default: false, with: {}, delegate: nil, child_mappings: nil, id: nil ) super( name, to: to, render_nil: render_nil, render_default: render_default, with: with, delegate: delegate, id: id ) @child_mappings = child_mappings end |
Instance Attribute Details
#child_mappings ⇒ Object (readonly)
Returns the value of attribute child_mappings.
6 7 8 |
# File 'lib/lutaml/model/key_value_mapping_rule.rb', line 6 def child_mappings @child_mappings end |
Instance Method Details
#deep_dup ⇒ Object
31 32 33 34 35 36 37 38 39 40 |
# File 'lib/lutaml/model/key_value_mapping_rule.rb', line 31 def deep_dup self.class.new( name.dup, to: to.dup, render_nil: render_nil.dup, with: Utils.deep_dup(custom_methods), delegate: delegate, child_mappings: Utils.deep_dup(child_mappings), ) end |