RosettaCodeData/Task/Respond-to-an-unknown-method-call/Fancy/respond-to-an-unknown-method-call.fancy
Ingy döt Net b83f433714 tasks a-s
2013-04-10 23:57:08 -07:00

20 lines
325 B
Text

class CatchThemAll {
def foo {
"foo received" println
}
def bar {
"bar received" println
}
def unknown_message: msg with_params: params {
"message: " ++ msg print
"arguments: " ++ (params join: ", ") println
}
}
a = CatchThemAll new
a foo
a bar
a we_can_do_it
a they_can_too: "eat" and: "walk"