v4.2.7 -
Show latest stable
-
2 notes
- Superclass:
Object
- 1.0.0 (0)
- 1.1.6 (0)
- 1.2.6 (0)
- 2.0.3 (0)
- 2.1.0 (0)
- 2.2.1 (0)
- 2.3.8 (0)
- 3.0.0 (38)
- 3.0.9 (-2)
- 3.1.0 (0)
- 3.2.1 (0)
- 3.2.8 (0)
- 3.2.13 (0)
- 4.0.2 (0)
- 4.1.8 (0)
- 4.2.1 (0)
- 4.2.7 (0)
- 4.2.9 (0)
- 5.0.0.1 (0)
- 5.1.7 (0)
- 5.2.3 (36)
- 6.0.0 (0)
- 6.1.3.1 (0)
- 6.1.7.7 (0)
- 7.0.0 (0)
- 7.1.3.2 (0)
- 7.1.3.4 (0)
- 7.2.3 (0)
- 8.0.0 (0)
- 8.1.1 (0)
- What's this?
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"
Constants
BLANK_RE = /\A[[:space:]]*\z/
Attributes
Register or
log in
to add new notes.
eric_programmer -
January 15, 2009
ncancelliere -
January 15, 2009 - (v1.2.6 - v2.2.1)
2 thanks
constantize
@ncancelliere - Instead use constantize which is provided as part of ActiveSupport. It is much easier. So:
mystring.constantize
0 thanks
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

