frozen_string_literal: true
frozen_string_literal: true
frozen_string_literal: true
frozen_string_literal: true
String inflections define new methods on the String class to transform names for different purposes. For instance, you can figure out the name of a table from the name of a class.
'ScaleScore'.tableize # => "scale_scores"
frozen_string_literal: true
frozen_string_literal: true
frozen_string_literal: true
Constants
ENCODED_BLANKS = Concurrent::Map.new do |h, enc| h[enc] = Regexp.new(BLANK_RE.source.encode(enc), BLANK_RE.options | Regexp::FIXEDENCODING) end
BLANK_RE = /\A[[:space:]]*\z/
Attributes
constantize
@ncancelliere - Instead use constantize which is provided as part of ActiveSupport. It is much easier. So:
mystring.constantize
Convert String to Class
this example shows how you can take a string and # make it a class and then send it a method
Kernel.const_get(my_string.capitalize).select_options