Created
November 6, 2016 01:20
-
-
Save apotonick/d6b3ed1f66de4932f82512ca7f35511f to your computer and use it in GitHub Desktop.
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
module PipeOperators | |
def <(*args) | |
A.new(self, "<") | |
end | |
def |(*args) | |
A.new(self) | |
end | |
class A | |
def initialize(klass, operator=">") | |
@klass, @operator = klass, operator | |
end | |
def |(*args) | |
@klass.<(*args) | |
end | |
def >(*args) | |
@klass.step(*args) | |
end | |
end | |
end | |
extend PipeOperators |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment