Class: Locomotive::Mounter::Models::Translation
- Defined in:
- lib/locomotive/mounter/models/translation.rb
Instance Attribute Summary
Attributes inherited from Base
#_id, #created_at, #mounting_point, #updated_at
Instance Method Summary collapse
-
#get(locale) ⇒ Object
methods ##.
-
#key ⇒ Object
fields ##.
- #to_params ⇒ Object
- #to_s ⇒ Object
Methods inherited from Base
Methods included from Fields
#[], #attributes, #attributes_with_translations, #initialize, #localized_field?, #to_hash, #to_yaml, #translated_in, #translated_in?, #write_attributes
Constructor Details
This class inherits a constructor from Locomotive::Mounter::Models::Base
Instance Method Details
#get(locale) ⇒ Object
methods ##
13 14 15 |
# File 'lib/locomotive/mounter/models/translation.rb', line 13 def get(locale) self.values[locale.to_s] end |
#key ⇒ Object
fields ##
8 |
# File 'lib/locomotive/mounter/models/translation.rb', line 8 field :key |
#to_params ⇒ Object
17 18 19 |
# File 'lib/locomotive/mounter/models/translation.rb', line 17 def to_params { key: self.key, values: self.values } end |
#to_s ⇒ Object
21 22 23 |
# File 'lib/locomotive/mounter/models/translation.rb', line 21 def to_s "Translation #{self.key} (#{self.values.keys.join(', ')})" end |