Method: LHS::Problems::Nested::Base#remove_scope

Defined in:
lib/lhs/problems/nested/base.rb

#remove_scope(messages, scope) ⇒ Object

Removes scope from given messages’ key



30
31
32
33
34
35
# File 'lib/lhs/problems/nested/base.rb', line 30

def remove_scope(messages, scope)
  messages.each_with_object({}) do |element, hash|
    key = element[0].to_s.gsub(/^#{scope}\./, '')
    hash[key.to_sym] = element[1]
  end
end