Sha256: bf50feb45bb1184e997f673f980af0d7b0ec26fe95038a28b53c885e58187e69
Contents?: true
Size: 484 Bytes
Versions: 12
Compression:
Stored size: 484 Bytes
Contents
# Adds some additional methods to String objects. # # @api public module Noumenon::StringExtensions # Attempts to convert a string into a constant. # # If the constant could not be found then a NameError will be raised. # # @example # "Foo::Bar".constantize # => Foo::Bar def constantize mod = Module split("::").each do |mod_name| mod = mod.const_get(mod_name.to_sym) end mod end end String.class_eval { include Noumenon::StringExtensions }
Version data entries
12 entries across 12 versions & 1 rubygems