Get class name from a class nested in a module in ruby -
if give you:
module module somethingelse class foo end end end
how class name of "foo"? in console, have similar example, when .name
on it doesn't print out expect.
this whats in console:
pry(main)> aisiswriter::controllers::commentsmanagement::commentshandler.name => "aisiswriter::controllers::commentsmanagement::commentshandler"
what expect "commentshandler"
you can do:
aisiswriter::controllers::commentsmanagement::commentshandler.name.split('::').last || ''
Comments
Post a Comment