KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
In the code below, method roar is not defined in class Lion , but still can be called using method_missing . class Lion def method_missing(name, *args) puts "Lion will #{name}: #{args[0]}" end end lion = Lion.new lion.roar("ROAR!!!") # => Lion will roar: ROAR!!! In which situations and how should I use this method_missing ? And is it safe to use?
Tags (comma-separated)
Save Edits
Cancel