Class: Ecm::Translations::ImportTranslationsService::TranslationInFileSystem

Inherits:
Object
  • Object
show all
Defined in:
app/services/ecm/translations/import_translations_service.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(raw_key, value) ⇒ TranslationInFileSystem

Returns a new instance of TranslationInFileSystem.



5
6
7
8
# File 'app/services/ecm/translations/import_translations_service.rb', line 5

def initialize(raw_key, value)
  @raw_key = raw_key
  @value = value
end

Instance Attribute Details

#keyObject

Returns the value of attribute key.



4
5
6
# File 'app/services/ecm/translations/import_translations_service.rb', line 4

def key
  @key
end

#localeObject

Returns the value of attribute locale.



4
5
6
# File 'app/services/ecm/translations/import_translations_service.rb', line 4

def locale
  @locale
end

#raw_keyObject

Returns the value of attribute raw_key.



4
5
6
# File 'app/services/ecm/translations/import_translations_service.rb', line 4

def raw_key
  @raw_key
end

#valueObject

Returns the value of attribute value.



4
5
6
# File 'app/services/ecm/translations/import_translations_service.rb', line 4

def value
  @value
end

Instance Method Details

#humanObject



10
11
12
# File 'app/services/ecm/translations/import_translations_service.rb', line 10

def human
  "#{locale} | #{@key}: #{@value}"
end

#to_translation_attributes_hashObject



22
23
24
25
26
27
28
29
# File 'app/services/ecm/translations/import_translations_service.rb', line 22

def to_translation_attributes_hash
  {
    locale: locale,
    key: key,
    value: value,
    is_proc: false
  }
end