Class: Hash

Inherits:
Object
  • Object
show all
Defined in:
lib/menumatic/hash.rb

Instance Method Summary collapse

Instance Method Details

#merge_with_join(other_hash, separator = " ") ⇒ Object

Behaves the same as [merge] but instead of replacing values, they are automatically joined using the separator parameter



4
5
6
# File 'lib/menumatic/hash.rb', line 4

def merge_with_join(other_hash, separator = " ")
  self.merge(other_hash){ |key, value_1, value_2| [value_1, value_2].join(separator) }
end