Class: TranslatableString
- Defined in:
- lib/translate_self/translatable_string.rb
Overview
A class that let’s you translate strings with the language and to_language params even if you happen to freeze them. Aliased to TString.
Constant Summary
Constants included from Translation
Instance Attribute Summary
Attributes included from Translation
Instance Method Summary collapse
-
#initialize(str, language: nil, to_language: nil) ⇒ TranslatableString
constructor
A new instance of TranslatableString.
Methods included from Translation
#available_languages, #lan, #to_language, #to_language=, #translate, #translate!
Constructor Details
#initialize(str, language: nil, to_language: nil) ⇒ TranslatableString
Returns a new instance of TranslatableString.
5 6 7 8 9 |
# File 'lib/translate_self/translatable_string.rb', line 5 def initialize(str, language: nil, to_language: nil) super str self.language = language self.to_language = to_language end |