We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0775ffe commit f55571aCopy full SHA for f55571a
1 file changed
lib/desktop/wx.ex
@@ -25,13 +25,9 @@ defmodule Desktop.Wx do
25
"""
26
)
27
28
- for wx_constant <- @constants do
29
- Code.eval_quoted(
30
- Code.string_to_quoted("""
31
- def wx#{wx_constant}, do: :desktop_wx.get(:wx#{wx_constant})
32
- """),
33
- [],
34
- module: __MODULE__
35
- )
36
- end
+ @constants
+ |> Enum.map(&String.to_atom("wx" <> &1))
+ |> Enum.each(fn prefixed_constant ->
+ def unquote(prefixed_constant)(), do: :desktop_wx.get(unquote(prefixed_constant))
+ end)
37
end
0 commit comments