Class: Hash
Instance Method Summary collapse
- #append_value(key, val, delimiter = ' ') ⇒ Object
- #append_value!(key, val, delimiter = ' ') ⇒ Object
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 |