class

String

v7.2.3 - Show latest stable - Superclass: Object

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

BLANK_RE = /\\A[[:space:]]*\\z/

ENCODED_BLANKS = Concurrent::Map.new do |h, enc|\nh[enc] = Regexp.new(BLANK_RE.source.encode(enc), BLANK_RE.options | Regexp::FIXEDENCODING)\nend

Files

  • activesupport/lib/active_support/core_ext/object/blank.rb
  • activesupport/lib/active_support/core_ext/object/json.rb
  • activesupport/lib/active_support/core_ext/string/access.rb
  • activesupport/lib/active_support/core_ext/string/behavior.rb
  • activesupport/lib/active_support/core_ext/string/conversions.rb
  • activesupport/lib/active_support/core_ext/string/exclude.rb
  • activesupport/lib/active_support/core_ext/string/filters.rb
  • activesupport/lib/active_support/core_ext/string/indent.rb
  • activesupport/lib/active_support/core_ext/string/inflections.rb
  • activesupport/lib/active_support/core_ext/string/inquiry.rb
  • activesupport/lib/active_support/core_ext/string/multibyte.rb
  • activesupport/lib/active_support/core_ext/string/output_safety.rb
  • activesupport/lib/active_support/core_ext/string/starts_ends_with.rb
  • activesupport/lib/active_support/core_ext/string/strip.rb
  • activesupport/lib/active_support/core_ext/string/zones.rb

1Note

constantize

eric_programmer ยท Jan 14, 20092 thanks

@ncancelliere - Instead use constantize which is provided as part of ActiveSupport. It is much easier. So:

mystring.constantize