View Source Ash.CodeInterface (ash v3.4.46)

Used to define the functions of a code interface for a resource.

Summary

Functions

define_interface(domain, resource, definitions \\ nil)

(macro)

Defines the code interface for a given resource + domain combination in the current module. For example:

defmodule MyApp.Accounting do
  require Ash.CodeInterface

  Ash.CodeInterface.define_interface(MyApp.Accounting, MyApp.Accounting.Transaction)
  Ash.CodeInterface.define_interface(MyApp.Accounting, MyApp.Accounting.Account)
  Ash.CodeInterface.define_interface(MyApp.Accounting, MyApp.Accounting.Invoice)
end

describe_action(resource, action, args)

describe_calculation(resource, calculation, args)

trim_double_newlines(str)

unwrap_calc_interface_args(keys, resource, arguments, function_head? \\ false)

without_optional(keys)