mirror of
https://github.com/ash-project/ash_oban.git
synced 2024-09-20 13:23:08 +12:00
15 lines
425 B
Elixir
15 lines
425 B
Elixir
defmodule AshOban.Info do
|
|
@moduledoc "Introspection for AshOban"
|
|
|
|
use Spark.InfoGenerator, extension: AshOban, sections: [:oban]
|
|
@pro Application.compile_env(:ash_oban, :pro?) || false
|
|
|
|
def pro?, do: @pro
|
|
|
|
@spec oban_trigger(Ash.Resource.t() | Spark.Dsl.t(), atom) :: nil | AshOban.Trigger.t()
|
|
def oban_trigger(resource, name) do
|
|
resource
|
|
|> oban_triggers()
|
|
|> Enum.find(&(&1.name == name))
|
|
end
|
|
end
|