Builder
Forge complex mental constructs step-by-step through ritualistic stages.
✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Builder
ARCANUM SCHOOL: Transmutation // Construct-Weaving
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// CONCURRENT ACTOR-MODEL ALCHEMY //
defmodule Tekromancy.Golem do
defstruct head: nil, core: nil, limbs: []
end
defmodule Tekromancy.GolemBuilder do
alias Tekromancy.Golem
def new, do: %Golem{}
def bind_core(golem, core_type) do
%{golem | core: core_type}
end
def attach_head(golem, head_type) do
%{golem | head: head_type}
end
def augment_limb(golem, limb) do
%{golem | limbs: [limb | golem.limbs]}
end
def awaken(golem) do
# Initiate actor process for the Golem
Task.start(fn -> loop(golem) end)
end
defp loop(state) do
receive do
:pulse -> IO.puts("Golem core #{state.core} pulses with arcane energy.")
end
loop(state)
end
end
When the assembly of a cyber-golem requires precise telepathic calibration, the Builder steps in. Using Elixir’s pipe operator |>, the ritual flows effortlessly from one stage to the next, weaving raw ether into a sentient actor ready to join the Supervisor’s web.
Runic Tags:
#elixir
#creational
#builder
#pipelines