Module: Splat::Insertion

Included in:
Gateway
Defined in:
lib/splat/insertion.rb

Instance Method Summary collapse

Instance Method Details

#insert_values(message, insertions = {}, default_insertions = {}) ⇒ Object



5
6
7
8
9
10
11
12
13
# File 'lib/splat/insertion.rb', line 5

def insert_values(message,insertions = {}, default_insertions = {})
  number_messsage_map = {}

  insertions.each do |key, value|
    i = -1
    insertions[key] = message.gsub(/\$\d/) {|match| value[i += 1] }
  end
  insertions
end