Created
April 22, 2015 23:09
-
-
Save nessamurmur/820beace73661303b3de to your computer and use it in GitHub Desktop.
Classes as partially applied functions
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
class Add | |
attr_reader :x | |
def initialize(x) | |
@x = x | |
end | |
def add(y) | |
x + y | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment