Metaprogramming in Ruby
In this guide you will learn how to use metaprogramming to allow for dynamic method calls.
Guide Tasks
- Read Tutorial
- Complete the Exercise
Summary
Build out a method that will use meta programming to allow for dynamic method calls.
Exercise description
"Define a method that will use meta programming to allow for dynamic method calls starting with hi."
Example Data
'expect(@mh.respond_to?(:hi_jon)).to eq(true)
expect(@mh.respond_to?(:hi_jane)).to eq(true)'
Real World Usage
Metaprogramming is used in Ruby in pretty much everything and this will help you understand more about it and the many thing you can do with it.