Skip to Main Content
Mastering Elixir
book

Mastering Elixir

by André Albuquerque, Daniel Caixinha
July 2018
Intermediate to advanced content levelIntermediate to advanced
574 pages
14h 7m
English
Packt Publishing
Content preview from Mastering Elixir

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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Testing Elixir

Testing Elixir

Andrea Leopardi, Jeffrey Matthias

Publisher Resources

ISBN: 9781788472678Supplemental Content