The Adapter
Bridging arcane interfaces through wrapper functions.
✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Adapter
ARCANUM SCHOOL: Transmutation // Interface Shifting
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// GLEAM PATTERN //
// Old API
pub type AncientScroll { AncientScroll(text: String) }
pub fn decipher(scroll: AncientScroll) -> String { scroll.text }
// New API
pub type ModernTablet { ModernTablet(content: String) }
// Adapter
pub fn scroll_to_tablet(scroll: AncientScroll) -> ModernTablet {
ModernTablet(content: decipher(scroll))
}
The Adapter
A pure function maps the shape of ancient magic into modern, type-safe structures.
Runic Tags:
#transmutation
#adapter
#gleam