Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/ext/string.rb

Direct Known Subclasses

LocalizedString

Instance Method Summary collapse

Instance Method Details

#with_lang(lng) ⇒ self

Helper method to set the language of the string.

Examples:

"Bonjour".with_lang(:fr).sub(/.$/, "s")

Returns:

  • (self)


8
9
10
# File 'lib/ext/string.rb', line 8

def with_lang(lng)
  LocalizedString.new(self, lng)
end