Module: Rosette::Core::TranslationToHash
- Included in:
- Translation
- Defined in:
- lib/rosette/core/extractor/translation/translation_to_hash.rb
Overview
Turns a Translation into a hash. Must be mixed into a Translation-like class.
Instance Method Summary collapse
-
#to_h ⇒ Hash
Converts the attributes of a Translation into a hash of attributes.
Instance Method Details
#to_h ⇒ Hash
Converts the attributes of a Rosette::Core::Translation into a hash of attributes. This includes the attributes of the associated Phrase object, which is also converted to a hash via the PhraseToHash module.
22 23 24 |
# File 'lib/rosette/core/extractor/translation/translation_to_hash.rb', line 22 def to_h { locale: locale, translation: translation, phrase: phrase.to_h } end |