Sha256: 2cd8ca828534754aaaaea2933652004a869fff6738b9de6b07f97de80896f687

Contents?: true

Size: 789 Bytes

Versions: 2

Compression:

Stored size: 789 Bytes

Contents

require_relative "mapping_rule"

module Lutaml
  module Model
    class KeyValueMappingRule < MappingRule
      attr_reader :child_mappings

      def initialize(
        name,
        to:,
        render_nil: false,
        with: {},
        delegate: nil,
        child_mappings: nil
      )
        super(
          name,
          to: to,
          render_nil: render_nil,
          with: with,
          delegate: delegate,
        )

        @child_mappings = child_mappings
      end

      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
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
lutaml-model-0.3.15 lib/lutaml/model/key_value_mapping_rule.rb
lutaml-model-0.3.14 lib/lutaml/model/key_value_mapping_rule.rb