Module: Sevgi::Graphics::Modules

Defined in:
lib/sevgi/graphics/mixtures/call.rb

Overview

Recursive callable drawing module support. Extend a module with this API when it and the modules defined beneath it form a callable drawing namespace. Existing and subsequently defined descendants receive the same recursive contract. Classes, autoloads, and modules aliased from another namespace are left unchanged.

Examples:

Define a callable drawing namespace

module Icons
  extend Sevgi::Graphics::Modules

  module Alert
    base { css ".alert" => { fill: "red" } }

    def call(id)
      circle id:, class: "alert", r: 5
    end
  end
end

Sevgi::Graphics.SVG { Call Icons::Alert, "warning" }

See Also: