Class: I18nChecker::Locale::KeyPath
- Inherits:
-
Object
- Object
- I18nChecker::Locale::KeyPath
- Defined in:
- lib/i18n_checker/locale/key_path.rb
Instance Attribute Summary collapse
-
#keys ⇒ Object
readonly
Returns the value of attribute keys.
Instance Method Summary collapse
- #current ⇒ Object
-
#initialize ⇒ KeyPath
constructor
A new instance of KeyPath.
- #leave ⇒ Object
- #move_to(key) ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize ⇒ KeyPath
Returns a new instance of KeyPath.
6 7 8 |
# File 'lib/i18n_checker/locale/key_path.rb', line 6 def initialize @keys = [] end |
Instance Attribute Details
#keys ⇒ Object (readonly)
Returns the value of attribute keys.
4 5 6 |
# File 'lib/i18n_checker/locale/key_path.rb', line 4 def keys @keys end |
Instance Method Details
#current ⇒ Object
18 19 20 |
# File 'lib/i18n_checker/locale/key_path.rb', line 18 def current @keys.join('.') end |
#leave ⇒ Object
14 15 16 |
# File 'lib/i18n_checker/locale/key_path.rb', line 14 def leave @keys.pop end |
#move_to(key) ⇒ Object
10 11 12 |
# File 'lib/i18n_checker/locale/key_path.rb', line 10 def move_to(key) @keys.push(key) end |
#to_s ⇒ Object
22 23 24 |
# File 'lib/i18n_checker/locale/key_path.rb', line 22 def to_s current end |