Module: Musa::Extension

Defined in:
lib/musa-dsl/core-ext/extension.rb,
lib/musa-dsl/core-ext/with.rb,
lib/musa-dsl/matrix/matrix.rb,
lib/musa-dsl/core-ext/arrayfy.rb,
lib/musa-dsl/core-ext/hashify.rb,
lib/musa-dsl/core-ext/deep-copy.rb,
lib/musa-dsl/core-ext/inspect-nice.rb,
lib/musa-dsl/core-ext/dynamic-proxy.rb,
lib/musa-dsl/neumas/array-to-neumas.rb,
lib/musa-dsl/neumas/string-to-neumas.rb,
lib/musa-dsl/core-ext/attribute-builder.rb,
lib/musa-dsl/core-ext/smart-proc-binder.rb,
lib/musa-dsl/core-ext/array-explode-ranges.rb

Overview

Namespace for core Ruby extensions and utilities used throughout Musa DSL.

This module contains fundamental extensions and helper modules that enhance Ruby's capabilities for DSL construction and flexible block handling.

Included Modules

Purpose

These extensions enable Musa DSL's characteristic features:

  • Builder pattern with flexible context switching
  • Method-style and block-style parameter passing
  • Dynamic method generation for DSL syntax
  • Intelligent parameter matching and binding

Design Philosophy

The extensions in this module prioritize:

  • Flexibility: Supporting multiple calling conventions
  • Transparency: Minimal interference with normal Ruby behavior
  • Reusability: General-purpose tools used across Musa DSL

Examples:

Using With for DSL blocks

class Builder
  include Musa::Extension::With

  def initialize(&block)
    @items = []
    with(&block) if block
  end

  def add(item)
    @items << item
  end
end

builder = Builder.new do
  add :foo  # Executes in Builder's context
end

See Also:

Defined Under Namespace

Modules: Arrayfy, AttributeBuilder, DeepCopy, DynamicProxy, ExplodeRanges, Hashify, InspectNice, Matrix, Neumas, SmartProcBinder, With