Class: TranslationJobs::MachineTranslationJob
- Inherits:
-
Object
- Object
- TranslationJobs::MachineTranslationJob
- Defined in:
- lib/has_many_translations/translation_jobs.rb
Instance Attribute Summary collapse
-
#translated_id ⇒ Object
Returns the value of attribute translated_id.
-
#translated_type ⇒ Object
Returns the value of attribute translated_type.
Instance Method Summary collapse
-
#initialize(options) ⇒ MachineTranslationJob
constructor
A new instance of MachineTranslationJob.
- #perform ⇒ Object
Constructor Details
#initialize(options) ⇒ MachineTranslationJob
Returns a new instance of MachineTranslationJob.
5 6 7 8 |
# File 'lib/has_many_translations/translation_jobs.rb', line 5 def initialize() @translated_id = ["translated_id"] || [:translated_id] @translated_type = ["translated_type"] || [:translated_type] end |
Instance Attribute Details
#translated_id ⇒ Object
Returns the value of attribute translated_id.
4 5 6 |
# File 'lib/has_many_translations/translation_jobs.rb', line 4 def translated_id @translated_id end |
#translated_type ⇒ Object
Returns the value of attribute translated_type.
4 5 6 |
# File 'lib/has_many_translations/translation_jobs.rb', line 4 def translated_type @translated_type end |
Instance Method Details
#perform ⇒ Object
9 10 11 12 13 |
# File 'lib/has_many_translations/translation_jobs.rb', line 9 def perform translatable = Kernel.const_get(@translated_type).find(@translated_id) translatable.update_translations! end |