Skip to content

Instantly share code, notes, and snippets.

@avdi
Created October 2, 2015 15:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save avdi/ab0354ffbe61e0e77e8d to your computer and use it in GitHub Desktop.
Save avdi/ab0354ffbe61e0e77e8d to your computer and use it in GitHub Desktop.
class Symbol
def call(*curry_args)
->(receiver, *args) {
receiver.public_send(self, *curry_args, *args)
}
end
end
data = [{'x'=>1}, {'x'=>2},{'x'=>'foo'}]
data.map(&:[].('x'))
# => [1, 2, "foo"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment