Class: R18n::TranslatedString
- Inherits:
-
String
- Object
- String
- R18n::TranslatedString
- Defined in:
- lib/r18n-core/translated_string.rb
Overview
String, which is translated to some locale and loading from Translation.
Instance Attribute Summary collapse
-
#locale ⇒ Object
readonly
String locale.
-
#path ⇒ Object
readonly
Path for this translation.
Instance Method Summary collapse
-
#initialize(str, locale, path) ⇒ TranslatedString
constructor
Returns a new string object containing a copy of
str
, which translated forpath
tolocale
. -
#translated? ⇒ Boolean
Return true for translated strings.
-
#|(default) ⇒ Object
Return self for translated string.
Constructor Details
#initialize(str, locale, path) ⇒ TranslatedString
Returns a new string object containing a copy of str
, which translated for path
to locale
32 33 34 35 36 |
# File 'lib/r18n-core/translated_string.rb', line 32 def initialize(str, locale, path) super(str) @locale = locale @path = path end |
Instance Attribute Details
#locale ⇒ Object (readonly)
String locale
25 26 27 |
# File 'lib/r18n-core/translated_string.rb', line 25 def locale @locale end |
#path ⇒ Object (readonly)
Path for this translation.
28 29 30 |
# File 'lib/r18n-core/translated_string.rb', line 28 def path @path end |
Instance Method Details
#translated? ⇒ Boolean
Return true for translated strings.
44 45 46 |
# File 'lib/r18n-core/translated_string.rb', line 44 def translated? true end |
#|(default) ⇒ Object
Return self for translated string.
39 40 41 |
# File 'lib/r18n-core/translated_string.rb', line 39 def |(default) self end |