Lets say I have I class called
a = Person::User::Base How can I get only the last subclass called Base.
The way i know how to do this is:
a.to_s.split('::').last => "Base" Is there a better way?
If you use Rails (ActiveSupport):
a.to_s.demodulize
If you use POR (plain-ol-Ruby), yes, it's your way:
a.to_s.split('::').last
"Base:0x007fd84b37b948>"