Class: I18nAdd::YamlProcessor::KeyContext
- Inherits:
-
Object
- Object
- I18nAdd::YamlProcessor::KeyContext
- Defined in:
- lib/i18n_add/yaml_processor.rb
Overview
Encapsulates context for processing a single key level
Instance Attribute Summary collapse
-
#indentation ⇒ Object
readonly
Returns the value of attribute indentation.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#level ⇒ Object
readonly
Returns the value of attribute level.
-
#translation ⇒ Object
readonly
Returns the value of attribute translation.
Instance Method Summary collapse
- #final_key? ⇒ Boolean
-
#initialize(key:, level:, translation:, indentation:) ⇒ KeyContext
constructor
A new instance of KeyContext.
Constructor Details
#initialize(key:, level:, translation:, indentation:) ⇒ KeyContext
Returns a new instance of KeyContext.
243 244 245 246 247 248 |
# File 'lib/i18n_add/yaml_processor.rb', line 243 def initialize(key:, level:, translation:, indentation:) @key = key @level = level @translation = translation @indentation = indentation end |
Instance Attribute Details
#indentation ⇒ Object (readonly)
Returns the value of attribute indentation.
241 242 243 |
# File 'lib/i18n_add/yaml_processor.rb', line 241 def indentation @indentation end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
241 242 243 |
# File 'lib/i18n_add/yaml_processor.rb', line 241 def key @key end |
#level ⇒ Object (readonly)
Returns the value of attribute level.
241 242 243 |
# File 'lib/i18n_add/yaml_processor.rb', line 241 def level @level end |
#translation ⇒ Object (readonly)
Returns the value of attribute translation.
241 242 243 |
# File 'lib/i18n_add/yaml_processor.rb', line 241 def translation @translation end |
Instance Method Details
#final_key? ⇒ Boolean
250 251 252 |
# File 'lib/i18n_add/yaml_processor.rb', line 250 def final_key? @level == @translation.keys.size - 1 end |