Objects are functions! Treat any Object or Class as a Proc (like Enum
https://github.com/delonnewman/invokable - A function is a mapping of one value to another with the additional constraint that for the one input value you will always get the same output value. So, conceptually, Ruby Hashes, Arrays, and Sets are all functions. Also, there are many one method objects out there (e.g. Service Objects) that are essentially functions. Why not treat them as such?
Post a comment