lib/runbox/scenario/template_inspector.ex

defmodule Runbox.Scenario.TemplateInspector do
  @moduledoc group: :internal
  @moduledoc """
  Behaviour used to detect scenario template source files.
  """

  @callback valid_template?(module) :: boolean
  @callback template_info(module) :: term

  @doc """
  Validate whether given module is valid template source file.
  """
  @spec valid_template?(module, module) :: boolean
  def valid_template?(inspector_mod, template_mod) do
    inspector_mod.valid_template?(template_mod)
  end

  @doc """
  Retrieve implementation specific information about a template.
  """
  @spec template_info(module, module) :: term
  def template_info(inspector_mod, template_mod) do
    inspector_mod.template_info(template_mod)
  end
end