lib/lite/ruby/string.rb in lite-ruby-1.0.8 vs lib/lite/ruby/string.rb in lite-ruby-1.0.9

- old
+ new

@@ -85,11 +85,11 @@ end # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity # rubocop:disable Metrics/MethodLength, Metrics/PerceivedComplexity def constantize - names = camel_cased_word.split('::') - Object.const_get(camel_cased_word) if names.empty? + names = split('::') + Object.const_get(self) if names.empty? names.shift if names.size > 1 && names.first.empty? names.inject(Object) do |constant, name| return constant.const_get(name) if constant == Object