ruby-metaprogramming

Installation
SKILL.md

Ruby Metaprogramming

Master Ruby's powerful metaprogramming capabilities to write code that writes code. Ruby's dynamic nature makes it exceptionally good at metaprogramming.

Dynamic Method Definition

define_method

class Person
  [:name, :age, :email].each do |attribute|
    define_method(attribute) do
      instance_variable_get("@#{attribute}")
    end

    define_method("#{attribute}=") do |value|
      instance_variable_set("@#{attribute}", value)
    end
  end
Related skills
Installs
24
GitHub Stars
152
First Seen
Jan 22, 2026