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