TIL: Anonymous module support in Ruby


Today I Learned: Ruby supports anonymous Modules, just as it supports anonymous Classes.

While looking into customizing the returned response from Doorkeepers TokenController I found that Ruby supports anonymous modules. Which is quite handy for duck typing in Ruby.

Here is a quick example of how it works:

Ruby `Module.new` example.



Henrik Hauge Bjørnskov

I build stuff at Relatel A/S, vivid traveller and gear junkie.