Which programming language is this?
class Ghost
def method_missing(name, *args)
name.to_s.start_with?("say_") ? name.to_s.sub("say_", "") : super
end
def respond_to_missing?(name, include_private = false)
name.to_s.start_with?("say_") || super
end
end
puts Ghost.new.say_boo
Answer: Ruby
Overriding
Play Programming Languages ▸
method_missing and respond_to_missing? with a bare super and method names ending in ? is Ruby metaprogramming.