Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/dm-translatable.rb

Instance Method Summary collapse

Instance Method Details

#constantizeObject



5
6
7
8
9
# File 'lib/dm-translatable.rb', line 5

def constantize
  self.split("::").tap do |s|
    s.shift if s.first.empty?
  end.inject(Module) {|acc, val| acc.const_get(val)}
end