We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3c6fe53 commit b65a592Copy full SHA for b65a592
1 file changed
lib/desktop/wx.ex
@@ -24,12 +24,9 @@ defmodule Desktop.Wx do
24
"""
25
)
26
27
- for wx_constant <- @constants do
28
- Module.eval_quoted(
29
- __MODULE__,
30
- Code.string_to_quoted("""
31
- def wx#{wx_constant}, do: :desktop_wx.get(:wx#{wx_constant})
32
- """)
33
- )
34
- 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)
35
end
0 commit comments