name) • Job: Freelance web developer • Activities: Kaigi on Rails founder, Ruby community organizer, public speaker, OSS programmer (Alba is the most famous one) • Status: Job opportunities are welcome!
• A method that de fi nes a method • Kernel#eval • A method that treats strings as Ruby code • Object#send • A method that treats an argument as a method name
BasicObject#method_missing • It does something when Ruby does important things • Scope change such as BasicObject#instance_eval • It mimics as if the current self is that object • Class.new • A method that returns a new class that is de fi ned dynamically
It modi fi es existing classes only in current fi le • TracePoint • It does something when Ruby does… things (even new line) • Binding • It returns a “binding”, which includes things such as current local variables
and we cannot solve the problem otherwise • When we understand what we are doing well • When the components with metaprogramming is well encapsulated and isolated from other parts of the code
it cannot solve the problem otherwise • KISS (Keep It Simple, Stupid) • When we understand what we are doing well • Of course :) • When the components with metaprogramming is well encapsulated and isolated from other parts of the code • Basic OOP principle
have enough knowledge about how Ruby works • Read “Metaprogramming Ruby” book fi rst! • When you work on something you don’t understand well enough • It tends to be over-engineering • When you work on something that must be stable • Stable interfaces must hide metaprogramming back