Class: Hash

Inherits:
Object show all
Defined in:
lib/core_utilities/core_ext/hash.rb

Instance Method Summary collapse

Instance Method Details

#append_value(key, val, delimiter = ' ') ⇒ Object



2
3
4
# File 'lib/core_utilities/core_ext/hash.rb', line 2

def append_value(key, val, delimiter=' ')
  self.dup[key] = [ self[key], val ].compact.join(delimiter)
end

#append_value!(key, val, delimiter = ' ') ⇒ Object



6
7
8
# File 'lib/core_utilities/core_ext/hash.rb', line 6

def append_value!(key, val, delimiter=' ')
  self[key]     = [ self[key], val ].compact.join(delimiter)
end