Class: Hash
- Inherits:
-
Object
- Object
- Hash
- Defined in:
- lib/menumatic/hash.rb
Instance Method Summary collapse
-
#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.
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 |