Reputation: 8185
How can I show all defined constants with the word "AjaxDatatablesRails"
in it?
I tried this:
::AjaxDatatablesRails::Extensions
# >> NameError: uninitialized constant AjaxDatatablesRails::Extensions
Upvotes: 2
Views: 410
Reputation: 28305
Module.constants.grep /AjaxDatatablesRails/
Module.constants
returns an array of the names of all constants accessible from the point of call.
Enumerable#grep
then loops through this array, and filters out the names matching the given pattern.
Upvotes: 6