Class: TranslatedString
- Inherits:
-
String
- Object
- String
- TranslatedString
- Defined in:
- lib/lolita-translation/translated_string.rb
Instance Method Summary collapse
- #in(locale) ⇒ Object
-
#initialize(str, translation_record, attribute_name) ⇒ TranslatedString
constructor
A new instance of TranslatedString.
Constructor Details
#initialize(str, translation_record, attribute_name) ⇒ TranslatedString
Returns a new instance of TranslatedString.
2 3 4 5 6 |
# File 'lib/lolita-translation/translated_string.rb', line 2 def initialize(str, translation_record, attribute_name) @translation_record = translation_record @attribute_name = attribute_name super(str) end |
Instance Method Details
#in(locale) ⇒ Object
8 9 10 |
# File 'lib/lolita-translation/translated_string.rb', line 8 def in(locale) @translation_record.translated_attribute(@attribute_name, :locale => locale) end |