Collecting a list of pipeline steps

To collect the pipeline steps, we will register a @pipeline_steps module attribute. But, this time, we will pass the :accumulate option, meaning that every time this module attribute is used, it will append to its current value the value passed to it. When the compilation ends, the @pipeline_steps module attribute will contain a list with all those values, in our case all the pipeline steps:

$ cat apps/elixir_drip/lib/elixir_drip/dsl/pipeliner.exdefmodule ElixirDrip.Pipeliner do  # ...  defmacro __using__(opts) do    # ...    IO.puts "Building Pipeliner: #{name}"    quote do      # ...      Module.register_attribute(__MODULE__, :pipeline_steps,       accumulate: true)      @before_compile unquote(__MODULE__) def show_pipeline_steps do ...

Get Mastering Elixir now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.