Sha256: 1039a214372fc18575c6aa2b0d5e6af379dade59946df62cd29a72c25a671fe8

Contents?: true

Size: 479 Bytes

Versions: 2

Compression:

Stored size: 479 Bytes

Contents

require "dave_string_helper/version"

module DaveStringHelper
  def self.reversify(str)
    str.split('').reverse.join('')
  end

  def self.casify(str)
    to_case = [:upcase, :downcase]
    arr = str.split('')
    arr.each_with_index do |letter, i|
      this_case = to_case.sample
      arr[i] = letter.send(this_case)
    end
    arr.join('')
  end

  def self.spacify(str, spaces = 0)
    spaces.times do 
      str = str.split('').join(" ")
    end
    str
  end

end





Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
dave_string_helper-1.0.0 lib/dave_string_helper.rb
dave_string_helper-0.1.1 lib/dave_string_helper.rb