Raxol.Core.Renderer.View.Validation (Raxol v2.6.0)

View Source

Validation functions for the View module. Extracted from the main View module to improve maintainability.

Summary

Functions

Ensures opts is a keyword list; returns [] for non-lists.

Normalises padding/margin on a view map.

Validates that opts is a keyword list; raises ArgumentError otherwise. Public so it can be called from View macros via full module name.

Validates layout dimensions and raises an error if invalid.

Validates view options and raises an error if invalid.

Validates view type and raises an error if invalid.

Functions

ensure_keyword_list(opts)

Ensures opts is a keyword list; returns [] for non-lists.

normalize_spacing(view)

Normalises padding/margin on a view map.

validate_keyword_opts(opts, function_name)

Validates that opts is a keyword list; raises ArgumentError otherwise. Public so it can be called from View macros via full module name.

validate_layout_dimensions(dimensions)

Validates layout dimensions and raises an error if invalid.

validate_view_options(opts)

Validates view options and raises an error if invalid.

validate_view_type(type)

Validates view type and raises an error if invalid.