DEV Community

Akhil
Akhil

Posted on • Updated on

Ruby 2.8 adds endless method definition

Ruby 2.8 adds endless method definition

Top comments (1)

Collapse
 
codeandclay profile image
Oliver

Endless method definition is a mind-twister of a term but I like the idea of defining methods with the assignment operator. It's a nice halfway between using instance vars that do a bit more than attr_accessors and methods. On the other hand, when I scan Ruby by eye, my eye skips to the next line as soon as I've read def method_name and endless methods make it a bit harder for my brain to scan them (though, that's only habit).