S
snacktime
If this is too strange just say so. Tonight I was working with a
rails helper method which accepts several symbols as arguments which
get turned into method calls. Normally it's used on activerecord
objects, but I wanted to make it work on an array of hashes instead.
That particular approach wouldn't work without being able to call
values.first, since some of the hash values were arrays themselves,
but the rails helper expected a single array.
So anyways I was thinking how it would work if you could do something like this:
send
method1:method2:method3)
Arguments would be passed like normal, and the argument to a chained
method would be the result of the last method call.
Not sure I even like the idea, just curious if it's ever been discussed before?
Chris
rails helper method which accepts several symbols as arguments which
get turned into method calls. Normally it's used on activerecord
objects, but I wanted to make it work on an array of hashes instead.
That particular approach wouldn't work without being able to call
values.first, since some of the hash values were arrays themselves,
but the rails helper expected a single array.
So anyways I was thinking how it would work if you could do something like this:
send
Arguments would be passed like normal, and the argument to a chained
method would be the result of the last method call.
Not sure I even like the idea, just curious if it's ever been discussed before?
Chris