TIL, 2018-02-12, smart_init
- On focusing: just minimize all the damn tabs that you’re reading.
smart_init gem study:
- You can do things like this to have the “created as a base class with the mixin” if you either need to have both mixin and base class form.
class SmartInit::Base extend SmartInit end
define_singleton_methodbasically creates a class method with the arguments in a block. You can call it like this:
def is_callable define_singleton_method :call do |*parameters| new(*parameters).call end end
test_unitlooks simple enough, or is it just like the most basic example? Lol.