Last active
August 29, 2015 14:05
-
-
Save seejohnrun/1fac606a8e59fd71fbde to your computer and use it in GitHub Desktop.
satirical ruby
This file contains 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
class String | |
def |(other) | |
other.call(*self) | |
end | |
def >(other) | |
File.write(other, *self) | |
0 | |
end | |
end | |
# define a method that we want to pipe into | |
def reverse(arg) | |
arg.reverse | |
end | |
# pipe away | |
'john' | method(:reverse) > 'out.json' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment