Search documentation of ash

# View Source Ash.CodeInterface (ash v3.4.30)

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

# Summary

## Functions

define_interface(domain, resource, definitions \\ nil)

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

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)

# Functions

Link to this macro

# define_interface(domain, resource, definitions \\ nil)

View Source (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

Link to this function

# describe_action(resource, action, args)

View Source
Link to this function

# describe_calculation(resource, calculation, args)

View Source
Link to this function

# trim_double_newlines(str)

View Source
Link to this function

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

View Source
Link to this function

# without_optional(keys)

View Source