diff options
Diffstat (limited to 'lib/lkn/core/specs.ex')
-rw-r--r-- | lib/lkn/core/specs.ex | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/lkn/core/specs.ex b/lib/lkn/core/specs.ex index eb0cb37..986b29a 100644 --- a/lib/lkn/core/specs.ex +++ b/lib/lkn/core/specs.ex @@ -33,7 +33,7 @@ defmodule Lkn.Core.Specs do end)) end - def gen_server_plugin_entry_point(block, key_type, key_to_name, state_type) do + def gen_server_plugin_entry_point(block, key_type, key_to_name, additional_args, state_type) do block = case block do {:__block__, _, x} -> x x -> [x] @@ -46,7 +46,7 @@ defmodule Lkn.Core.Specs do plugin = quote do :plugin end casts_client = Enum.map(casts, &(cast_client(plugin, var_name("key"), key_type, key_to_name, &1))) - casts_behaviour = Enum.map(casts, &(cast_server(&1, var_name("key"), key_type, [], state_type, "_plugin"))) + casts_behaviour = Enum.map(casts, &(cast_server(&1, var_name("key"), key_type, additional_args, state_type, "_plugin"))) quote do unquote(casts_client) @@ -141,9 +141,10 @@ defmodule Lkn.Core.Specs do name = String.to_atom(String.replace_suffix(Atom.to_string(name), "", impl_suffix)) arglistcl_type = [{:::, [], [key_name, key_type]} - |Enum.map(cast.fun.arguments, &({:::, [], [&1.name, &1.type]}))] ++ additional_args ++ [ - {:::, [], [{:state, [], nil}, state_type]} - ] + |Enum.map(cast.fun.arguments, &({:::, [], [&1.name, &1.type]}))] + ++ additional_args ++ [ + {:::, [], [{:state, [], nil}, state_type]} + ] arglistcl = [key_name |Enum.map(cast.fun.arguments, &(&1.name))] ++ Enum.map(additional_args, &(case &1 do |