Class: I18nChecker::Locale::KeyPath

Inherits:
Object
  • Object
show all
Defined in:
lib/i18n_checker/locale/key_path.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeKeyPath

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

#keysObject (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

#currentObject



18
19
20
# File 'lib/i18n_checker/locale/key_path.rb', line 18

def current
  @keys.join('.')
end

#leaveObject



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_sObject



22
23
24
# File 'lib/i18n_checker/locale/key_path.rb', line 22

def to_s
  current
end