Module: GroupingHelper

Included in:
Kakimasu::KeysController
Defined in:
app/helpers/grouping_helper.rb

Instance Method Summary collapse

Instance Method Details

#get_translation_key_paths(array) ⇒ Object

Gets all paths from keys array



8
9
10
# File 'app/helpers/grouping_helper.rb', line 8

def get_translation_key_paths(array)
  array.map { |el| el.last }
end

#group_by_language(array) ⇒ Object

Groups all translations by language in array



3
4
5
# File 'app/helpers/grouping_helper.rb', line 3

def group_by_language(array)
  array.group_by { |el| el.partition('.').first }
end