Class: TranslatedString

Inherits:
String
  • Object
show all
Defined in:
lib/lolita-translation/translated_string.rb

Instance Method Summary collapse

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