Class: I18nAdd::YamlProcessor::TranslationEntry

Inherits:
Object
  • Object
show all
Defined in:
lib/i18n_add/yaml_processor.rb

Overview

Encapsulates a translation entry with its key path and value

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key_path:, value:) ⇒ TranslationEntry

Returns a new instance of TranslationEntry.



232
233
234
235
236
# File 'lib/i18n_add/yaml_processor.rb', line 232

def initialize(key_path:, value:)
  @key_path = key_path
  @value = value
  @keys = key_path.split(".")
end

Instance Attribute Details

#key_pathObject (readonly)

Returns the value of attribute key_path.



230
231
232
# File 'lib/i18n_add/yaml_processor.rb', line 230

def key_path
  @key_path
end

#keysObject (readonly)

Returns the value of attribute keys.



230
231
232
# File 'lib/i18n_add/yaml_processor.rb', line 230

def keys
  @keys
end

#valueObject (readonly)

Returns the value of attribute value.



230
231
232
# File 'lib/i18n_add/yaml_processor.rb', line 230

def value
  @value
end