Class: AdLocalize::ViewModels::TranslationGroupViewModel
- Inherits:
-
Object
- Object
- AdLocalize::ViewModels::TranslationGroupViewModel
- Defined in:
- lib/ad_localize/view_models/translation_group_view_model.rb
Instance Attribute Summary collapse
-
#label ⇒ Object
readonly
Returns the value of attribute label.
-
#translation_view_models ⇒ Object
readonly
Returns the value of attribute translation_view_models.
Instance Method Summary collapse
- #has_translations? ⇒ Boolean
-
#initialize(label:, translation_view_models:) ⇒ TranslationGroupViewModel
constructor
A new instance of TranslationGroupViewModel.
Constructor Details
#initialize(label:, translation_view_models:) ⇒ TranslationGroupViewModel
Returns a new instance of TranslationGroupViewModel.
9 10 11 12 |
# File 'lib/ad_localize/view_models/translation_group_view_model.rb', line 9 def initialize(label:, translation_view_models:) @label = label @translation_view_models = translation_view_models end |
Instance Attribute Details
#label ⇒ Object (readonly)
Returns the value of attribute label.
4 5 6 |
# File 'lib/ad_localize/view_models/translation_group_view_model.rb', line 4 def label @label end |
#translation_view_models ⇒ Object (readonly)
Returns the value of attribute translation_view_models.
4 5 6 |
# File 'lib/ad_localize/view_models/translation_group_view_model.rb', line 4 def translation_view_models @translation_view_models end |
Instance Method Details
#has_translations? ⇒ Boolean
14 15 16 |
# File 'lib/ad_localize/view_models/translation_group_view_model.rb', line 14 def has_translations? (translation_view_models || []).any?(&:has_value?) end |