Module: Useful::RubyExtensions::String::ClassMethods
- Defined in:
- lib/useful/ruby_extensions/string.rb,
lib/useful/ruby_extensions/string.rb
Instance Method Summary collapse
-
#hsub(string, hash) ⇒ Object
adds the contents of a2 to a1, removing duplicates.
Instance Method Details
#hsub(string, hash) ⇒ Object
adds the contents of a2 to a1, removing duplicates
13 14 15 16 |
# File 'lib/useful/ruby_extensions/string.rb', line 13 def hsub(string, hash) hash.each {|k,v| string.gsub!(":#{k}",v.to_s)} string end |