I have an object literal that I'm using to group methods. I'd like to be able to call a whole group of methods easily, like so:
group =
methodA: (str) ->
console.log str + "from method A"
methodB: (str) ->
console.log str + "from method B"
for method in group
method "hello"
# should log to console:
# "hello from method A"
# "hello from method B"
When I try this it doesn't seem to work. What am I missing / how should you go about looping through a group of methods like this?