Created
September 16, 2014 02:35
-
-
Save raecoo/9c05819afa792f478762 to your computer and use it in GitHub Desktop.
Remove useless whitespace by Lambda
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
thunk = lambda do |key,value| | |
case value | |
when String then value.strip! | |
when Hash then value.each(&thunk) | |
when Array then value.each {|vv| vv.strip!} | |
end | |
end | |
[Hash].each(&thunk) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ruby 2.1.x test passed