Class String
In: lib/merb-core/core_ext/string.rb
lib/merb-core/vendor/facets/inflect.rb
Parent: Object

Methods

Public Instance methods

Parameters

o<String>:The path component to join with the string.

Returns

String:The original path concatenated with o.

Examples

  "merb"/"core_ext" #=> "merb/core_ext"

Returns

String:The string converted to camel case.

Examples

  "foo_bar".camel_case #=> "FooBar"

Returns

String:The string with all regexp special characters escaped.

Examples

  "*?{}.".escape_regexp #=> "\\*\\?\\{\\}\\."
pluralize()

Alias for plural

Parameters ====

other<String>:Base path to calculate against

Returns ====

String:Relative path from between the two

Example ====

"/opt/local/lib".relative_path_from("/opt/local/lib/ruby/site_ruby") # => "../.."

singularize()

Alias for singular

Returns

String:The string converted to snake case.

Examples

  "FooBar".snake_case #=> "foo_bar"
  "HeadlineCNNNews".snake_case #=> "headline_cnn_news"
  "CNN".snake_case #=> "cnn"

Returns

String:The path that is associated with the constantized string, assuming a conventional structure.

Examples

  "FooBar::Baz".to_const_path # => "foo_bar/baz"

Returns

String:The path string converted to a constant name.

Examples

  "merb/core_ext/string".to_const_string #=> "Merb::CoreExt::String"

Returns

String:The string with all regexp special characters unescaped.

Examples

  "\\*\\?\\{\\}\\.".unescape_regexp #=> "*?{}."

[Validate]