Class: Translatomatic::Translation
- Inherits:
-
Object
- Object
- Translatomatic::Translation
- Defined in:
- lib/translatomatic/translation.rb
Overview
Data object describing a text translation
Instance Attribute Summary collapse
-
#from_database ⇒ boolean
readonly
True if this translation came from the database.
-
#original ⇒ Translatomatic::String
readonly
Original string.
-
#result ⇒ Translatomatic::String
Translated string.
-
#translator ⇒ Symbol
readonly
The name of the translator.
Instance Method Summary collapse
-
#initialize(original, result, translator = nil, from_database = false) ⇒ Translation
constructor
A new instance of Translation.
Constructor Details
#initialize(original, result, translator = nil, from_database = false) ⇒ Translation
Returns a new instance of Translation.
16 17 18 19 20 21 |
# File 'lib/translatomatic/translation.rb', line 16 def initialize(original, result, translator = nil, from_database = false) @original = original @result = result @translator = translator @from_database = from_database end |
Instance Attribute Details
#from_database ⇒ boolean (readonly)
Returns True if this translation came from the database.
14 15 16 |
# File 'lib/translatomatic/translation.rb', line 14 def from_database @from_database end |
#original ⇒ Translatomatic::String (readonly)
Returns original string.
5 6 7 |
# File 'lib/translatomatic/translation.rb', line 5 def original @original end |
#result ⇒ Translatomatic::String
Returns translated string.
8 9 10 |
# File 'lib/translatomatic/translation.rb', line 8 def result @result end |
#translator ⇒ Symbol (readonly)
Returns The name of the translator.
11 12 13 |
# File 'lib/translatomatic/translation.rb', line 11 def translator @translator end |