Method: Commander::UI.replace_tokens

Defined in:
lib/commander/user_interaction.rb

.replace_tokens(str, hash) ⇒ Object

Substitute hash’s keys with their associated values in str.



341
342
343
344
345
# File 'lib/commander/user_interaction.rb', line 341

def replace_tokens str, hash #:nodoc:
  hash.inject str do |str, (key, value)|
    str.gsub ":#{key}", value.to_s
  end
end