Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/inline_acceleration.rb

Instance Method Summary collapse

Instance Method Details

#to_classObject



20
21
22
23
24
25
26
27
28
29
# File 'lib/inline_acceleration.rb', line 20

def to_class
  names = self.split('::')
  klass = Object
  names.each do |name|
    sym = name.to_sym
    return nil if !klass.const_defined?(sym)
    klass = klass.const_get(sym)
  end
  klass
end