Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/berkshelf/core_ext/string.rb

Instance Method Summary collapse

Instance Method Details

#prepend_each(separator, value) ⇒ String

Separates the string on the given separator and prepends the given value to each and returns a new string from the result.

Parameters:

Returns:



9
10
11
# File 'lib/berkshelf/core_ext/string.rb', line 9

def prepend_each(separator, value)
  lines(separator).collect { |x| value + x }.join
end