Skip to content

Instantly share code, notes, and snippets.

@makevoid
Created April 5, 2015 04:19
Show Gist options
  • Select an option

  • Save makevoid/e72c4287ecc2c22754ed to your computer and use it in GitHub Desktop.

Select an option

Save makevoid/e72c4287ecc2c22754ed to your computer and use it in GitHub Desktop.
Transproc example - Why are you still using activesupport?
T_FOO = Transproc(:hash_recursion, Transproc(:symbolize_keys)) + Transproc(:hash_recursion, Transproc(:map_hash, foo: :bar))
T_FOO.( foo: "baz", child: { "foo" => "asd" } )
# =>
# {:child=>{:bar=>"asd"}, :bar=>"baz"}
# quiz: try to refactor the example using function composition :D
# see the readme (https://github.com/solnic/transproc) and the specs (https://github.com/solnic/transproc/tree/master/spec/integration) for more infos
@makevoid

makevoid commented Apr 5, 2015

Copy link
Copy Markdown
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment