Module: Lutaml::Xml::TransformationSupport::SkipLogic

Includes:
Model::RenderPolicy
Included in:
RuleApplier
Defined in:
lib/lutaml/xml/transformation/skip_logic.rb

Overview

Module for determining if values should be skipped during serialization.

Delegates to the shared Lutaml::Model::RenderPolicy module for consistent behavior across XML and KeyValue formats.

Handles skip logic based on:

  • render_nil and render_empty options

  • value_map configurations

  • Default value usage

  • Collection handling

Instance Method Summary collapse

Methods included from Model::RenderPolicy

derived_attribute_for?

Instance Method Details

#should_skip_delegated_value?(value, rule, delegate_obj) ⇒ Boolean

Check if delegated value should be skipped

Parameters:

  • value (Object)

    The value to check

  • rule (CompiledRule)

    The rule

  • delegate_obj (Object)

    The delegated object instance

Returns:

  • (Boolean)

    true if should skip



35
36
37
38
39
# File 'lib/lutaml/xml/transformation/skip_logic.rb', line 35

def should_skip_delegated_value?(value, rule, delegate_obj)
  return true if delegate_obj.nil?

  check_skip_logic?(value, rule, delegate_obj)
end

#should_skip_value?(value, rule, model_instance) ⇒ Boolean

Check if value should be skipped based on render options

Parameters:

  • value (Object)

    The value to check

  • rule (CompiledRule)

    The rule

  • model_instance (Object)

    The model instance

Returns:

  • (Boolean)

    true if should skip



25
26
27
# File 'lib/lutaml/xml/transformation/skip_logic.rb', line 25

def should_skip_value?(value, rule, model_instance)
  check_skip_logic?(value, rule, model_instance)
end