SnakeBridge.ModuleResolver (SnakeBridge v0.15.1)

Copy Markdown View Source

Resolves ambiguous module paths to class attributes or submodules.

Summary

Functions

Determines if an Elixir module maps to a Python class attribute or submodule.

Types

resolution()

@type resolution() ::
  {:class, String.t(), String.t()} | {:submodule, String.t()} | {:error, term()}

Functions

resolve_class_or_submodule(library, elixir_module)

@spec resolve_class_or_submodule(map(), module()) :: resolution()

Determines if an Elixir module maps to a Python class attribute or submodule.

Returns:

  • {:class, class_name, parent_module} when the last path segment is a class.
  • {:submodule, module_path} when the path resolves to a submodule.
  • {:error, reason} when introspection fails.