3 ms·
That looks like you're having to make a Weeks class just so you can do the same thing, instead of adding it to Integer and having it available on any int.
by goatlover 5y ago
That looks like you're having to make a Weeks class just so you can do the same thing, instead of adding it to Integer and having it available on any int.
- eloisius 5y agoIn Ruby at least this example would just be an instance method named Weeks on the kernel class and it wouldn’t really be any more clunky to implement than the ActiveSupport flavor. However because Ruby you’re still reopening a class. You’re just adding a method to Kernel instead of Integer.
- Fire-Dragon-DoL 5y agoThat would just be a global method in ruby. At the top of any file: def Weeks(arg) end