Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 355 def constantize(camel_cased_word)
- 356 names = camel_cased_word.split('::')
- 357 names.shift if names.empty? || names.first.empty?
- 358
- 359 constant = Object
- 360 names.each do |name|
- 361 constant = constant.const_defined?(name) ? constant.const_get(name) : constant.const_missing(name)
- 362 end
- 363 constant
- 364 en
Add Comment
Please, Sign In to add comment